2003-11-16 21:43:43 +00:00
|
|
|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
1999-11-07 21:55:12 +00:00
|
|
|
*
|
2004-04-18 22:01:16 +00:00
|
|
|
* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1999-11-07 21:55:12 +00:00
|
|
|
*
|
2004-04-18 22:01:16 +00:00
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
1999-11-07 21:55:12 +00:00
|
|
|
* for the specific language governing rights and limitations under the
|
2004-04-18 22:01:16 +00:00
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org Code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
1999-11-07 21:55:12 +00:00
|
|
|
*
|
2004-04-18 22:01:16 +00:00
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1999-11-07 21:55:12 +00:00
|
|
|
|
|
|
|
#ifndef nsJARURI_h__
|
|
|
|
#define nsJARURI_h__
|
|
|
|
|
|
|
|
#include "nsIJARURI.h"
|
2001-07-31 19:05:34 +00:00
|
|
|
#include "nsISerializable.h"
|
2004-12-02 07:00:25 +00:00
|
|
|
#include "nsIClassInfo.h"
|
1999-11-07 21:55:12 +00:00
|
|
|
#include "nsCOMPtr.h"
|
2002-03-06 07:48:55 +00:00
|
|
|
#include "nsString.h"
|
2006-05-02 18:54:19 +00:00
|
|
|
#include "nsINestedURI.h"
|
1999-11-07 21:55:12 +00:00
|
|
|
|
2004-05-20 23:29:52 +00:00
|
|
|
#define NS_THIS_JARURI_IMPL_CID \
|
|
|
|
{ /* 9a55f629-730b-4d08-b75b-fa7d9570a691 */ \
|
|
|
|
0x9a55f629, \
|
|
|
|
0x730b, \
|
|
|
|
0x4d08, \
|
|
|
|
{0xb7, 0x5b, 0xfa, 0x7d, 0x95, 0x70, 0xa6, 0x91} \
|
|
|
|
}
|
|
|
|
|
2004-12-02 07:00:25 +00:00
|
|
|
#define NS_JARURI_CLASSNAME \
|
|
|
|
"nsJARURI"
|
|
|
|
#define NS_JARURI_CID \
|
|
|
|
{ /* 245abae2-b947-4ded-a46d-9829d3cca462 */ \
|
|
|
|
0x245abae2, \
|
|
|
|
0xb947, \
|
|
|
|
0x4ded, \
|
|
|
|
{0xa4, 0x6d, 0x98, 0x29, 0xd3, 0xcc, 0xa4, 0x62} \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-05-02 18:54:19 +00:00
|
|
|
class nsJARURI : public nsIJARURI,
|
|
|
|
public nsISerializable,
|
|
|
|
public nsIClassInfo,
|
|
|
|
public nsINestedURI
|
1999-11-07 21:55:12 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIURI
|
2003-11-16 21:43:43 +00:00
|
|
|
NS_DECL_NSIURL
|
1999-11-07 21:55:12 +00:00
|
|
|
NS_DECL_NSIJARURI
|
2001-07-31 19:05:34 +00:00
|
|
|
NS_DECL_NSISERIALIZABLE
|
2004-12-02 07:00:25 +00:00
|
|
|
NS_DECL_NSICLASSINFO
|
2006-05-02 18:54:19 +00:00
|
|
|
NS_DECL_NSINESTEDURI
|
1999-11-07 21:55:12 +00:00
|
|
|
|
2005-11-11 14:36:26 +00:00
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_THIS_JARURI_IMPL_CID)
|
2005-01-23 23:03:39 +00:00
|
|
|
|
1999-11-07 21:55:12 +00:00
|
|
|
// nsJARURI
|
|
|
|
nsJARURI();
|
|
|
|
virtual ~nsJARURI();
|
|
|
|
|
2002-03-06 07:48:55 +00:00
|
|
|
nsresult Init(const char *charsetHint);
|
2003-10-03 22:15:24 +00:00
|
|
|
nsresult FormatSpec(const nsACString &entryPath, nsACString &result,
|
|
|
|
PRBool aIncludeScheme = PR_TRUE);
|
2003-11-16 21:43:43 +00:00
|
|
|
nsresult CreateEntryURL(const nsACString& entryFilename,
|
|
|
|
const char* charset,
|
|
|
|
nsIURL** url);
|
2005-01-23 23:03:39 +00:00
|
|
|
nsresult SetSpecWithBase(const nsACString& aSpec, nsIURI* aBaseURL);
|
1999-11-07 21:55:12 +00:00
|
|
|
|
|
|
|
protected:
|
2011-05-22 01:12:45 +00:00
|
|
|
// enum used in a few places to specify how .ref attribute should be handled
|
|
|
|
enum RefHandlingEnum {
|
|
|
|
eIgnoreRef,
|
|
|
|
eHonorRef
|
|
|
|
};
|
|
|
|
|
|
|
|
// Helper to share code between Equals methods.
|
|
|
|
virtual nsresult EqualsInternal(nsIURI* other,
|
|
|
|
RefHandlingEnum refHandlingMode,
|
|
|
|
PRBool* result);
|
|
|
|
|
1999-11-07 21:55:12 +00:00
|
|
|
nsCOMPtr<nsIURI> mJARFile;
|
2003-11-16 21:43:43 +00:00
|
|
|
// mJarEntry stored as a URL so that we can easily access things
|
|
|
|
// like extensions, refs, etc.
|
|
|
|
nsCOMPtr<nsIURL> mJAREntry;
|
2002-03-06 07:48:55 +00:00
|
|
|
nsCString mCharsetHint;
|
1999-11-07 21:55:12 +00:00
|
|
|
};
|
|
|
|
|
2005-11-11 14:36:26 +00:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsJARURI, NS_THIS_JARURI_IMPL_CID)
|
|
|
|
|
1999-11-07 21:55:12 +00:00
|
|
|
#endif // nsJARURI_h__
|