Lowercased idl method names for scriptability. Cleaned up nsIURL interface.

This commit is contained in:
warren%netscape.com 1999-10-12 01:39:37 +00:00
Родитель 62cd20de05
Коммит 334b887595
27 изменённых файлов: 220 добавлений и 174 удалений

Просмотреть файл

@ -332,11 +332,26 @@ NS_IMETHODIMP nsMsgMailNewsUrl::GetFileName(char * *aFileName)
return m_baseURL->GetFileName(aFileName);
}
NS_IMETHODIMP nsMsgMailNewsUrl::GetFileBaseName(char * *aFileBaseName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsMsgMailNewsUrl::SetFileBaseName(const char * aFileBaseName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsMsgMailNewsUrl::GetFileExtension(char * *aFileExtension)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsMsgMailNewsUrl::SetFileExtension(const char * aFileExtension)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsMsgMailNewsUrl::SetFileName(const char * aFileName)
{
return m_baseURL->SetFileName(aFileName);
@ -372,8 +387,13 @@ NS_IMETHODIMP nsMsgMailNewsUrl::SetRef(const char *aRef)
return m_baseURL->SetRef(aRef);
}
NS_IMETHODIMP nsMsgMailNewsUrl::DirFile(char **o_DirFile)
NS_IMETHODIMP nsMsgMailNewsUrl::GetFilePath(char **o_DirFile)
{
return m_baseURL->DirFile(o_DirFile);
return m_baseURL->GetFilePath(o_DirFile);
}
NS_IMETHODIMP nsMsgMailNewsUrl::SetFilePath(const char *i_DirFile)
{
return m_baseURL->SetFilePath(i_DirFile);
}

Просмотреть файл

@ -49,7 +49,7 @@ interface nsIMailboxUrl : nsISupports {
attribute nsIStreamListener mailboxCopyHandler;
// mailbox URL state
readonly attribute nsFileSpecPtr filePath;
readonly attribute nsFileSpecPtr fileSpec;
// a message db header for that message.
readonly attribute nsIMsgDBHdr messageHeader;

Просмотреть файл

@ -213,7 +213,7 @@ nsresult nsMailboxUrl::GetMailboxCopyHandler(nsIStreamListener ** aMailboxCopyHa
return NS_OK;
}
nsresult nsMailboxUrl::GetFilePath(nsFileSpec ** aFilePath)
nsresult nsMailboxUrl::GetFileSpec(nsFileSpec ** aFilePath)
{
if (aFilePath)
*aFilePath = m_filePath;
@ -253,7 +253,7 @@ NS_IMETHODIMP nsMailboxUrl::GetURI(char ** aURI)
if (aURI)
{
nsFileSpec * filePath = nsnull;
GetFilePath(&filePath);
GetFileSpec(&filePath);
if (filePath)
{
char * baseuri = nsMailboxGetURI(m_file);
@ -347,7 +347,7 @@ nsresult nsMailboxUrl::ParseUrl(const nsString& aSpec)
{
if (m_filePath)
delete m_filePath;
DirFile(getter_Copies(m_file));
GetFilePath(getter_Copies(m_file));
ParseSearchPart();
m_filePath = new nsFileSpec(nsFilePath(m_file));
return NS_OK;

Просмотреть файл

@ -39,7 +39,7 @@ public:
NS_IMETHOD SetMailboxCopyHandler(nsIStreamListener * aConsumer);
NS_IMETHOD GetMailboxCopyHandler(nsIStreamListener ** aConsumer);
NS_IMETHOD GetFilePath(nsFileSpec ** aFilePath);
NS_IMETHOD GetFileSpec(nsFileSpec ** aFilePath);
NS_IMETHOD GetMessageKey(nsMsgKey* aMessageKey);
NS_IMETHOD GetMessageSize(PRUint32 *aMessageSize);
NS_IMETHOD SetMessageSize(PRUint32 aMessageSize);

Просмотреть файл

@ -87,7 +87,7 @@ NS_IMETHODIMP nsMsgMailboxParser::OnStartRequest(nsIChannel * /* aChannel */, ns
// okay, now fill in our event sinks...Note that each getter ref counts before
// it returns the interface to us...we'll release when we are done
nsXPIDLCString fileName;
url->DirFile(getter_Copies(fileName));
url->GetFilePath(getter_Copies(fileName));
url->GetFileName(getter_Copies(m_folderName));
if (fileName)
{

Просмотреть файл

@ -21,6 +21,6 @@
[scriptable, uuid(fb65fd70-1881-11d3-9337-00104ba0fd40)]
interface nsIEventSinkGetter : nsISupports
{
nsISupports GetEventSink(in string command, in nsIIDRef eventSinkIID);
nsISupports getEventSink(in string command, in nsIIDRef eventSinkIID);
};

Просмотреть файл

@ -30,23 +30,23 @@ native nsFileSpec(nsFileSpec&);
[scriptable, uuid(d4ced500-6882-11d3-9382-00104ba0fd40)]
interface nsIFileTransportService : nsISupports
{
[noscript] nsIChannel CreateTransport(in nsFileSpec spec, // XXX change to nsIFile later
[noscript] nsIChannel createTransport(in nsFileSpec spec, // XXX change to nsIFile later
in string command,
in nsIEventSinkGetter getter);
// This version can be used with an existing input stream to serve
// as a data pump:
nsIChannel CreateTransportFromStream(in nsIInputStream fromStream,
nsIChannel createTransportFromStream(in nsIInputStream fromStream,
in string contentType,
in long contentLength,
in string command,
in nsIEventSinkGetter getter);
void DispatchRequest(in nsIRunnable runnable);
void Suspend(in nsIRunnable trans);
void Resume(in nsIRunnable trans);
void ProcessPendingRequests();
void Shutdown();
void dispatchRequest(in nsIRunnable runnable);
void suspend(in nsIRunnable trans);
void resume(in nsIRunnable trans);
void processPendingRequests();
void shutdown();
};
%{C++

Просмотреть файл

@ -38,13 +38,13 @@ interface nsIIOService : nsISupports
/**
* Returns a protocol handler for a given URI scheme.
*/
nsIProtocolHandler GetProtocolHandler(in string scheme);
nsIProtocolHandler getProtocolHandler(in string scheme);
/**
* Returns an absolute URI string from a relative specification and
* a base URI.
*/
string MakeAbsolute(in string aRelativeSpec, in nsIURI aBaseURI);
string makeAbsolute(in string aRelativeSpec, in nsIURI aBaseURI);
/**
* This method constructs a new URI by first determining the scheme
@ -52,14 +52,14 @@ interface nsIIOService : nsISupports
* to the protocol handler for that scheme. QueryInterface can be used
* on the resulting URI object to obtain a more specific type of URI.
*/
nsIURI NewURI(in string aSpec, in nsIURI aBaseURI);
nsIURI newURI(in string aSpec, in nsIURI aBaseURI);
/**
* Creates a channel for a given URI. The eventSinkGetter is used to
* obtain the appropriate callbacks for the URI's protocol from the
* application.
*/
nsIChannel NewChannelFromURI(in string verb,
nsIChannel newChannelFromURI(in string verb,
in nsIURI aURI,
in nsILoadGroup aLoadGroup,
in nsIEventSinkGetter eventSinkGetter);
@ -68,7 +68,7 @@ interface nsIIOService : nsISupports
* Convenience routine that first creates a URI by calling NewURI, and
* then passes the URI to NewChannelFromURI.
*/
nsIChannel NewChannel(in string verb,
nsIChannel newChannel(in string verb,
in string aSpec,
in nsIURI aBaseURI,
in nsILoadGroup aLoadGroup,
@ -78,35 +78,35 @@ interface nsIIOService : nsISupports
* Get the application name string that will be used as part
* of a HTTP request.
*/
readonly attribute wstring AppCodeName;
readonly attribute wstring appCodeName;
/**
* Get the application version string that will be used as part
* of a HTTP request.
*/
readonly attribute wstring AppVersion;
readonly attribute wstring appVersion;
/**
* Get the application name.
*/
readonly attribute wstring AppName;
readonly attribute wstring appName;
/**
* Get the translation of the application. The value for language
* is usually a 2-letter code such as "en" and occasionally a
* five-character code to indicate a language subtype, such as "zh_CN".
*/
attribute wstring Language;
attribute wstring language;
/**
* Get the current platform (machine type).
*/
readonly attribute wstring Platform;
readonly attribute wstring platform;
/**
* Get the HTTP advertised user agent string.
*/
readonly attribute wstring UserAgent;
readonly attribute wstring userAgent;
/**
* Returns a new stream observer that marshals data from another
@ -114,7 +114,7 @@ interface nsIIOService : nsISupports
* If the event queue is null, the current thread's event queue is
* used.
*/
nsIStreamObserver NewAsyncStreamObserver(in nsIStreamObserver receiver,
nsIStreamObserver newAsyncStreamObserver(in nsIStreamObserver receiver,
in nsIEventQueue eventQueue);
/**
@ -122,21 +122,21 @@ interface nsIIOService : nsISupports
* by the thread's event queue. The receiver stream listener is then used to receive
* the data on the other thread.
*/
nsIStreamListener NewAsyncStreamListener(in nsIStreamListener receiver,
nsIStreamListener newAsyncStreamListener(in nsIStreamListener receiver,
in nsIEventQueue eventQueue);
/**
* A synchronous stream listener pushes data through a pipe that ends up
* in an input stream to be read by another thread.
*/
nsIStreamListener NewSyncStreamListener(out nsIInputStream inStream,
nsIStreamListener newSyncStreamListener(out nsIInputStream inStream,
out nsIBufferOutputStream outStream);
/**
* This convenience routine first looks up the file protocol handler, and
* then uses it to construct a file channel from a native path string.
*/
nsIFileChannel NewChannelFromNativePath(in string nativePath);
nsIFileChannel newChannelFromNativePath(in string nativePath);
/**
* Returns a new load group. Load groups can be used to manage collections
@ -144,7 +144,7 @@ interface nsIIOService : nsISupports
* their use is not required by other parts of the system, they are primarily
* a convenience for the caller. The outer parameter can be used for aggregation.
*/
nsILoadGroup NewLoadGroup(in nsISupports outer,
nsILoadGroup newLoadGroup(in nsISupports outer,
in nsIStreamObserver observer,
in nsILoadGroup parent);
@ -154,7 +154,7 @@ interface nsIIOService : nsISupports
* by the channel's GetURI method. This routine is a convenience facililty
* for protocol writers.
*/
nsIChannel NewInputStreamChannel(in nsIURI uri,
nsIChannel newInputStreamChannel(in nsIURI uri,
in string contentType,
in long contentLength,
in nsIInputStream inStr,

Просмотреть файл

@ -28,7 +28,7 @@ interface nsIInputStream;
[scriptable, uuid(60fdf550-5392-11d3-9a97-0080c7cb1080)]
interface nsILoadGroupListenerFactory : nsISupports
{
nsIStreamListener CreateLoadGroupListener(in nsIStreamListener alistener);
nsIStreamListener createLoadGroupListener(in nsIStreamListener alistener);
};
@ -38,7 +38,7 @@ interface nsILoadGroupListenerFactory : nsISupports
[scriptable, uuid(19845248-29ab-11d3-8cce-0060b0fc14a3)]
interface nsILoadGroup : nsIRequest
{
void Init(in nsIStreamObserver observer,
void init(in nsIStreamObserver observer,
in nsILoadGroup parent);
/**
@ -46,14 +46,14 @@ interface nsILoadGroup : nsIRequest
* a flag word. Setting the default load attributes will cause them
* to be applied to each new channel inserted into the group.
*/
attribute unsigned long DefaultLoadAttributes;
attribute unsigned long defaultLoadAttributes;
/**
* Accesses the default load channel for the group. Each time a number
* of channels are added to a group, the DefaultLoadChannel may be set
* to indicate that all of the channels are related to a particular URL.
*/
attribute nsIChannel DefaultLoadChannel;
/**
* Accesses the default load channel for the group. Each time a number
* of channels are added to a group, the DefaultLoadChannel may be set
* to indicate that all of the channels are related to a particular URL.
*/
attribute nsIChannel defaultLoadChannel;
/**
* Adds a new channel to the group. This will cause the default load
@ -61,7 +61,7 @@ interface nsILoadGroup : nsIRequest
* the first channel in the group, the group's observer's OnStartRequest
* method is called.
*/
void AddChannel(in nsIChannel channel,
void addChannel(in nsIChannel channel,
in nsISupports ctxt);
/**
@ -69,7 +69,7 @@ interface nsILoadGroup : nsIRequest
* the last channel in the group, the group's observer's OnStopRequest
* method is called.
*/
void RemoveChannel(in nsIChannel channel,
void removeChannel(in nsIChannel channel,
in nsISupports ctxt,
in nsresult status,
in wstring errorMsg);
@ -78,25 +78,25 @@ interface nsILoadGroup : nsIRequest
* Returns the channels contained directly in this group.
* Enumerator element type: nsIChannel.
*/
readonly attribute nsISimpleEnumerator Channels;
readonly attribute nsISimpleEnumerator channels;
/**
* Adds a new sub-group to the group.
*/
void AddSubGroup(in nsILoadGroup group);
void addSubGroup(in nsILoadGroup group);
/**
* Removes a sub-group from the group.
*/
void RemoveSubGroup(in nsILoadGroup group);
void removeSubGroup(in nsILoadGroup group);
/**
* Returns the sub-groups of a group.
* Enumerator element type: nsILoadGroup.
*/
readonly attribute nsISimpleEnumerator SubGroups;
readonly attribute nsISimpleEnumerator subGroups;
attribute nsILoadGroupListenerFactory GroupListenerFactory;
attribute nsILoadGroupListenerFactory groupListenerFactory;
};
%{C++

Просмотреть файл

@ -35,9 +35,9 @@ interface nsINetNotify;
[scriptable, uuid(9F482BD0-1476-11d3-A15A-0050041CAF44)]
interface nsINetModRegEntry : nsISupports
{
readonly attribute nsINetNotify SyncProxy;
readonly attribute nsINetNotify AsyncProxy;
readonly attribute string Topic;
readonly attribute nsINetNotify syncProxy;
readonly attribute nsINetNotify asyncProxy;
readonly attribute string topic;
boolean Equals(in nsINetModRegEntry aEntry);
boolean equals(in nsINetModRegEntry aEntry);
};

Просмотреть файл

@ -55,7 +55,7 @@ interface nsINetModuleMgr : nsISupports {
// aNotify: The external module interface methods to be called when an event is fired.
//
// RETURNS: nsresult
void RegisterModule(in string aTopic, in nsINetNotify aNotify);
void registerModule(in string aTopic, in nsINetNotify aNotify);
// Unregister the external module. Removes the nsINetModuleMgr binding between
// internal component and external module.
@ -65,12 +65,12 @@ interface nsINetModuleMgr : nsISupports {
// aNotify: The external modules notification module.
//
// RETURNS: nsresult
void UnregisterModule(in string aTopic, in nsINetNotify aNotify);
void unregisterModule(in string aTopic, in nsINetNotify aNotify);
// Enumerates all the registered modules for the specified topic.
//
// ARGUMENTS:
// aTopic: the component to get all the notifiers for.
// aEnumerator: the array of notifiers.
void EnumerateModules(in string aTopic, out nsISimpleEnumerator aEnumerator);
};
void enumerateModules(in string aTopic, out nsISimpleEnumerator aEnumerator);
};

Просмотреть файл

@ -32,7 +32,7 @@ interface nsIProgressEventSink : nsISupports
/**
* Notify the EventSink that progress as occurred for the URL load.<BR>
*/
void OnProgress(in nsIChannel channel,
void onProgress(in nsIChannel channel,
in nsISupports ctxt,
in unsigned long aProgress,
in unsigned long aProgressMax);
@ -40,7 +40,7 @@ interface nsIProgressEventSink : nsISupports
/**
* Notify the EventSink with a status message for the URL load.<BR>
*/
void OnStatus(in nsIChannel channel,
void onStatus(in nsIChannel channel,
in nsISupports ctxt,
in wstring aMsg);

Просмотреть файл

@ -24,20 +24,20 @@ interface nsIPrompt : nsISupports
/**
* Puts up an alert dialog with an OK button.
*/
void Alert(in wstring text);
void alert(in wstring text);
/**
* Puts up a dialog with OK and Cancel buttons.
* @return true for OK, false for Cancel
*/
boolean Confirm(in wstring text);
boolean confirm(in wstring text);
/**
* Puts up a dialog with OK and Cancel buttons, and
* a message with a single checkbox.
* @return true for OK, false for Cancel
*/
boolean ConfirmCheck(in wstring text,
boolean confirmCheck(in wstring text,
in wstring checkMsg,
out boolean checkValue);
@ -45,14 +45,14 @@ interface nsIPrompt : nsISupports
* Puts up a dialog with Yes and No buttons.
* @return true for OK, false for Cancel
*/
boolean ConfirmYN(in wstring text);
boolean confirmYN(in wstring text);
/**
* Puts up a dialog with Yes and No buttons, and
* a message with a single checkbox.
* @return true for OK, false for Cancel
*/
boolean ConfirmCheckYN(in wstring text,
boolean confirmCheckYN(in wstring text,
in wstring checkMsg,
out boolean checkValue);
@ -60,7 +60,7 @@ interface nsIPrompt : nsISupports
* Puts up a text input dialog with OK and Cancel buttons.
* @return true for OK, false for Cancel
*/
boolean Prompt(in wstring text,
boolean prompt(in wstring text,
in wstring defaultText,
out wstring result);
@ -68,7 +68,7 @@ interface nsIPrompt : nsISupports
* Puts up a username/password dialog with OK and Cancel buttons.
* @return true for OK, false for Cancel
*/
boolean PromptUsernameAndPassword(in wstring text,
boolean promptUsernameAndPassword(in wstring text,
out wstring user,
out wstring pwd);
@ -76,6 +76,6 @@ interface nsIPrompt : nsISupports
* Puts up a password dialog with OK and Cancel buttons.
* @return true for OK, false for Cancel
*/
boolean PromptPassword(in wstring text,
boolean promptPassword(in wstring text,
out wstring pwd);
};

Просмотреть файл

@ -26,11 +26,11 @@ interface nsILoadGroup;
[scriptable, uuid(8984a6f0-1893-11d3-9337-00104ba0fd40)]
interface nsIProtocolHandler : nsISupports
{
readonly attribute string Scheme;
readonly attribute string scheme;
readonly attribute long DefaultPort;
readonly attribute long defaultPort;
string MakeAbsolute(in string aRelativeSpec, in nsIURI aBaseURI);
string makeAbsolute(in string aRelativeSpec, in nsIURI aBaseURI);
/**
* Makes a URI object that is suitable for loading by this protocol.
@ -38,11 +38,11 @@ interface nsIProtocolHandler : nsISupports
* needed), this method just constructs a standard URI using the
* component manager with kStandardURLCID.
*/
nsIURI NewURI(in string aSpec, in nsIURI aBaseURI);
nsIURI newURI(in string aSpec, in nsIURI aBaseURI);
nsIChannel NewChannel(in string verb,
nsIChannel newChannel(in string verb,
in nsIURI aURI,
in nsILoadGroup aLoadGroup,
in nsILoadGroup aLoadGroup,
in nsIEventSinkGetter eventSinkGetter);
};

Просмотреть файл

@ -26,13 +26,13 @@ interface nsIRequest : nsISupports
* after completion or successful calling Cancel. Suspended requests
* are still considered pending.
*/
boolean IsPending();
boolean isPending();
/**
* Cancels the current request. This will close any open input or
* output streams and terminate any async requests.
*/
void Cancel();
void cancel();
/**
* Suspends the current requests. This may have the effect of closing
@ -40,12 +40,12 @@ interface nsIRequest : nsISupports
* any open streams remain logically opened and will continue delivering
* data when the transport is resumed.
*/
void Suspend();
void suspend();
/**
* Resumes the current request. This may have the effect of re-opening
* any underlying transport and will resume the delivery of data to
* any open streams.
*/
void Resume();
void resume();
};

Просмотреть файл

@ -23,12 +23,12 @@ interface nsIChannel;
[scriptable, uuid(05331390-6884-11d3-9382-00104ba0fd40)]
interface nsISocketTransportService : nsISupports
{
nsIChannel CreateTransport(in string host,
nsIChannel createTransport(in string host,
in long port);
nsIChannel CreateTransportOfType(in string socketType,
nsIChannel createTransportOfType(in string socketType,
in string host,
in long port);
void Shutdown();
void shutdown();
};
%{C++

Просмотреть файл

@ -35,7 +35,7 @@ interface nsIStatusCodeEventSink : nsISupports
* Notify the EventSink with a status code for the URL load.<BR>
* Use IOService to request converting that code to a string.
*/
void OnStatus(in nsIChannel channel,
void onStatus(in nsIChannel channel,
in nsISupports ctxt,
in unsigned long aCode);

Просмотреть файл

@ -26,7 +26,7 @@ interface nsIEventQueue;
[scriptable, uuid(1a637020-1482-11d3-9333-00104ba0fd40)]
interface nsIStreamListener : nsIStreamObserver
{
void OnDataAvailable(in nsIChannel channel,
void onDataAvailable(in nsIChannel channel,
in nsISupports ctxt,
in nsIInputStream inStr,
in unsigned long sourceOffset,

Просмотреть файл

@ -24,10 +24,10 @@ interface nsIChannel;
[scriptable, uuid(fd91e2e0-1481-11d3-9333-00104ba0fd40)]
interface nsIStreamObserver : nsISupports
{
void OnStartRequest(in nsIChannel channel,
void onStartRequest(in nsIChannel channel,
in nsISupports ctxt);
void OnStopRequest(in nsIChannel channel,
void onStopRequest(in nsIChannel channel,
in nsISupports ctxt,
in nsresult status,
in wstring errorMsg);

Просмотреть файл

@ -58,7 +58,7 @@ interface nsIURI : nsISupports
* the spec (or any of the accessors) causes also any currently
* open streams on the URI's channel to be closed.
*/
attribute string Spec;
attribute string spec;
/**
* The Scheme is the protocol to which this URI refers. Setting
@ -67,19 +67,19 @@ interface nsIURI : nsISupports
* and passes the it to the nsIOService to create a new URI for
* the new scheme.
*/
attribute string Scheme;
attribute string scheme;
/**
* The PreHost portion includes elements like the optional
* username:password, or maybe other scheme specific items.
*/
attribute string PreHost;
attribute string preHost;
/**
* The Host is the internet domain name to which this URI refers.
* Note that it could be an IP address as well.
*/
attribute string Host;
attribute string host;
/**
* A return value of -1 indicates that no port value is set and the
@ -90,14 +90,14 @@ interface nsIURI : nsISupports
* However after setting a port (even if its default), the port number will
* appear in the ToNewCString function.
*/
attribute long Port;
attribute long port;
/**
* Note that the path includes the leading '/' Thus if no path is
* available the Path accessor will return a "/"
* For SetPath if none is provided, one would be prefixed to the path.
*/
attribute string Path;
attribute string path;
/**
* Note that this comparison is only on char* level. Use
@ -107,7 +107,7 @@ interface nsIURI : nsISupports
* but this function through nsIURI alone will not return equality
* for this case.
*/
boolean Equals(in nsIURI other);
boolean equals(in nsIURI other);
/**
* Clones the current URI. The newly created URI will be in a closed
@ -115,7 +115,7 @@ interface nsIURI : nsISupports
* Cloning allows the current location to be retained since once the
* channel is opened the URI may get redirected to a new location.
*/
nsIURI Clone();
nsIURI clone();
/**
* Sets the given string to be a relative path for this URL, and
@ -124,7 +124,7 @@ interface nsIURI : nsISupports
* change this to http://foo.com/baz and calling it with "baz" will
* change this to http://foo.com/bar/baz.
*/
void SetRelativePath(in string i_RelativePath);
void setRelativePath(in string i_RelativePath);
};
%{C++

Просмотреть файл

@ -21,11 +21,56 @@
interface nsIChannel;
interface nsIEventSinkGetter;
[scriptable, uuid(78406350-0ce5-11d3-9331-00104ba0fd40)]
/**
* The nsIURL interface provides convenience methods that further
* break down the path portion of nsIURI:
*
* http://directory/fileBaseName.fileExtension?query
* http://directory/fileBaseName.fileExtension#ref
* http://directory/fileBaseName.fileExtension;param
* \ \ /
* \ -----------------------
* \ | /
* \ fileName /
* ----------------------------
* |
* filePath
*/
[scriptable, uuid(d6116970-8034-11d3-9399-00104ba0fd40)]
interface nsIURL : nsIURI
{
// The following 4 attributes breakdown the Path attribute
// into its constituents...
////////////////////////////////////////////////////////////////////////////
// The path attribute is broken down into the following attributes:
// filePath, param, query, and ref:
/**
* Returns a path including the directory and file portions of a
* URL. E.g. The filePath of "http://foo/bar.html#baz" is
* "/foo/bar.html".
*/
attribute string filePath;
/**
* Returns the parameters specified after the ; in the URL.
*
*/
attribute string param;
/**
* Returns the query portion (the part after the "?") of the URL.
* If there isn't one, an empty string is returned.
*/
attribute string query;
/**
* Returns the reference portion (the part after the "#") of the URL.
* If there isn't one, an empty string is returned.
*/
attribute string ref;
////////////////////////////////////////////////////////////////////////////
// The filePath attribute is further broken down into the following
// attributes: directory, file:
/**
* Returns the directory portion of a URL.
@ -35,11 +80,11 @@ interface nsIURL : nsIURI
* empty string. If the trailing slash is omitted, then the
* Directory is /foo/ and the file is bar (i.e. this is a
* syntactic, not a semantic breakdown of the Path).
* And hence dont rely on this for something to be a definitely
* be a file. But you can get just the leading directory portion
* for sure.
* And hence dont rely on this for something to be a definitely
* be a file. But you can get just the leading directory portion
* for sure.
*/
attribute string Directory;
attribute string directory;
/**
* Returns the file name portion of a URL.
@ -47,39 +92,22 @@ interface nsIURL : nsIURI
* e.g. http://foo/bar/, then the Directory attribute accesses
* the complete /foo/bar/ portion, and the FileName is the
* empty string. Note that this is purely based on searching
* for the last trailing slash. And hence dont rely on this to
* be a definite file.
* for the last trailing slash. And hence dont rely on this to
* be a definite file.
*/
attribute string FileName;
attribute string fileName;
////////////////////////////////////////////////////////////////////////////
// The fileName attribute is further broken down into the following
// attributes: fileName, fileExtension:
attribute string fileBaseName;
/**
* Returns the file extension portion of a filename in a url.
* If a file extension does not exist, the empty string is returned.
*/
readonly attribute string FileExtension;
/**
* Returns the parameters specified after the ; in the URL.
*
*/
attribute string Param;
/**
* Returns the query portion (the part after the "?") of the URL.
* If there isn't one, an empty string is returned.
*/
attribute string Query;
/**
* Returns the reference portion (the part after the "#") of the URL.
* If there isn't one, an empty string is returned.
*/
attribute string Ref;
/**
* Returns the Directory + Filename. Just a convenience function
*/
void DirFile(out string o_DirFile);
attribute string fileExtension;
};
%{C++
@ -93,11 +121,11 @@ interface nsIURL : nsIURI
*/
#define NS_STANDARDURL_CID \
{ /* 46fc2a26-ff66-11d2-8ccb-0060b0fc14a3 */ \
0x46fc2a26, \
0xff66, \
0x11d2, \
{0x8c, 0xcb, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3} \
{ /* de9472d0-8034-11d3-9399-00104ba0fd40 */ \
0xde9472d0, \
0x8034, \
0x11d3, \
{0x93, 0x99, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \
}
%}

Просмотреть файл

@ -214,7 +214,12 @@ nsSimpleURI::Clone(nsIURI* *result)
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
NS_IMETHODIMP
nsSimpleURI::SetRelativePath(const char *i_RelativePath)
{
NS_ASSERTION(PR_FALSE, "This is meaningless in hack context!");
return NS_ERROR_FAILURE;
}
////////////////////////////////////////////////////////////////////////////////

Просмотреть файл

@ -34,46 +34,8 @@ class nsSimpleURI : public nsIURI
{
public:
NS_DECL_AGGREGATED
NS_DECL_NSIURI
////////////////////////////////////////////////////////////////////////////
// nsIURI methods:
/* attribute string Spec; */
NS_IMETHOD GetSpec(char * *aSpec);
NS_IMETHOD SetSpec(const char * aSpec);
/* attribute string Scheme; */
NS_IMETHOD GetScheme(char * *aScheme);
NS_IMETHOD SetScheme(const char * aScheme);
/* attribute string PreHost; */
NS_IMETHOD GetPreHost(char * *aPreHost);
NS_IMETHOD SetPreHost(const char * aPreHost);
/* attribute string Host; */
NS_IMETHOD GetHost(char * *aHost);
NS_IMETHOD SetHost(const char * aHost);
/* attribute long Port; */
NS_IMETHOD GetPort(PRInt32 *aPort);
NS_IMETHOD SetPort(PRInt32 aPort);
/* attribute string Path; */
NS_IMETHOD GetPath(char * *aPath);
NS_IMETHOD SetPath(const char * aPath);
/* boolean Equals (in nsIURI other); */
NS_IMETHOD Equals(nsIURI *other, PRBool *_retval);
/* nsIURI Clone (); */
NS_IMETHOD Clone(nsIURI **_retval);
/* void SetRelativePath (in string i_RelativePath); */
NS_IMETHOD SetRelativePath(const char *i_RelativePath) {
NS_ASSERTION(PR_FALSE, "This is meaningless in hack context!");
return NS_ERROR_FAILURE;};
////////////////////////////////////////////////////////////////////////////
// nsSimpleURI methods:
nsSimpleURI(nsISupports* outer);

Просмотреть файл

@ -742,6 +742,13 @@ nsReadFromSocket(void* closure,
len = PR_Read(fd, toRawSegment, count);
if (len > 0) {
*readCount = (PRUint32)len;
#ifdef DEBUG
for (PRUint32 i = 0; i < len; i++) {
if (toRawSegment[i] == '\0') {
printf("null at %d in %p %d %p\n", i, toRawSegment, len, toRawSegment + len);
}
}
#endif
}
//
// The read operation has completed...

Просмотреть файл

@ -1087,7 +1087,7 @@ nsStdURL::SetPath(const char* i_Path)
}
NS_METHOD
nsStdURL::DirFile(char **o_DirFile)
nsStdURL::GetFilePath(char **o_DirFile)
{
if (!o_DirFile)
return NS_ERROR_NULL_POINTER;
@ -1106,3 +1106,21 @@ nsStdURL::DirFile(char **o_DirFile)
return NS_ERROR_OUT_OF_MEMORY;
return NS_OK;
}
NS_METHOD
nsStdURL::SetFilePath(const char *filePath)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_METHOD
nsStdURL::GetFileBaseName(char **o_name)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_METHOD
nsStdURL::SetFileBaseName(const char *name)
{
return NS_ERROR_NOT_IMPLEMENTED;
}

Просмотреть файл

@ -149,6 +149,12 @@ nsStdURL::GetFileExtension(char* *o_FileExtension)
return NS_OK;
}
inline NS_METHOD
nsStdURL::SetFileExtension(const char* FileExtension)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
inline NS_METHOD
nsStdURL::GetRef(char* *o_Ref)
{

Просмотреть файл

@ -82,7 +82,7 @@ nsFileChannel::Init(nsIFileProtocolHandler* handler, const char* command, nsIURI
nsCOMPtr<nsIURL> aUrl = do_QueryInterface(mURI, &rv);
if (NS_SUCCEEDED(rv) && aUrl) { // does it support the url interface?
nsXPIDLCString fileString;
aUrl->DirFile(getter_Copies(fileString));
aUrl->GetFilePath(getter_Copies(fileString));
// to be mac friendly you need to convert a file path to a nsFilePath before
// passing it to a nsFileSpec...
#ifdef XP_MAC