#include "prtypes.h"#include "nscore.h"#include "nsError.h"#include "nsString.h"
Include dependency graph for nsEscape.h:Enumerations | |
| enum | nsEscapeMask { url_All = 0, url_XAlphas = ((PRUint32)1 << ( 0 )), url_XPAlphas = ((PRUint32)1 << ( 1 )), url_Path = ((PRUint32)1 << ( 2 )) } |
Valid mask values for nsEscape Note: these values are copied in nsINetUtil.idl. More... | |
| enum | EscapeMask { esc_Scheme = ((PRUint32)1 << ( 0 )), esc_Username = ((PRUint32)1 << ( 1 )), esc_Password = ((PRUint32)1 << ( 2 )), esc_Host = ((PRUint32)1 << ( 3 )), esc_Directory = ((PRUint32)1 << ( 4 )), esc_FileBaseName = ((PRUint32)1 << ( 5 )), esc_FileExtension = ((PRUint32)1 << ( 6 )), esc_FilePath = esc_Directory | esc_FileBaseName | esc_FileExtension, esc_Param = ((PRUint32)1 << ( 7 )), esc_Query = ((PRUint32)1 << ( 8 )), esc_Ref = ((PRUint32)1 << ( 9 )), esc_Minimal = esc_Scheme | esc_Username | esc_Password | esc_Host | esc_FilePath | esc_Param | esc_Query | esc_Ref, esc_Forced = ((PRUint32)1 << ( 10 )), esc_OnlyASCII = ((PRUint32)1 << ( 11 )), esc_OnlyNonASCII = ((PRUint32)1 << ( 12 )), esc_AlwaysCopy = ((PRUint32)1 << ( 13 )), esc_Colon = ((PRUint32)1 << ( 14 )), esc_SkipControl = ((PRUint32)1 << ( 15 )) } |
NS_EscapeURL/NS_UnescapeURL constants for |flags| parameter: More... | |
Functions | |
| char * | nsEscape (const char *str, nsEscapeMask mask) |
| Escape the given string according to mask. | |
| char * | nsUnescape (char *str) |
| PRInt32 | nsUnescapeCount (char *str) |
| char * | nsEscapeHTML (const char *string) |
| PRUnichar * | nsEscapeHTML2 (const PRUnichar *aSourceBuffer, PRInt32 aSourceBufferLen=-1) |
| PRBool | NS_EscapeURL (const char *str, PRInt32 len, PRUint32 flags, nsACString &result) |
| NS_EscapeURL. | |
| PRBool | NS_UnescapeURL (const char *str, PRInt32 len, PRUint32 flags, nsACString &result) |
| Expands URL escape sequences... | |
| PRInt32 | NS_UnescapeURL (char *str) |
| returns resultant string length | |
| const nsCSubstring & | NS_EscapeURL (const nsCSubstring &str, PRUint32 flags, nsCSubstring &result) |
| String friendly versions... | |
| const nsCSubstring & | NS_UnescapeURL (const nsCSubstring &str, PRUint32 flags, nsCSubstring &result) |
| PRBool | NS_Escape (const nsCString &aOriginal, nsCString &aEscaped, nsEscapeMask aMask) |
| CString version of nsEscape. | |
| nsCString & | NS_UnescapeURL (nsCString &str) |
| Inline unescape of mutable string object. | |
| enum EscapeMask |
NS_EscapeURL/NS_UnescapeURL constants for |flags| parameter:
Note: These values are copied to nsINetUtil.idl Any changes should be kept in sync
| enum nsEscapeMask |
Valid mask values for nsEscape Note: these values are copied in nsINetUtil.idl.
Any changes should be kept in sync.
| PRBool NS_Escape | ( | const nsCString & | aOriginal, | |
| nsCString & | aEscaped, | |||
| nsEscapeMask | aMask | |||
| ) | [inline] |
CString version of nsEscape.
Returns true on success, false on out of memory. To reverse this function, use NS_UnescapeURL.
| PRBool NS_EscapeURL | ( | const char * | str, | |
| PRInt32 | len, | |||
| PRUint32 | flags, | |||
| nsACString & | result | |||
| ) |
NS_EscapeURL.
Escapes invalid char's in an URL segment. Has no side-effect if the URL segment is already escaped. Otherwise, the escaped URL segment is appended to |result|.
| str | url segment string | |
| len | url segment string length (-1 if unknown) | |
| flags | url segment type flag | |
| result | result buffer, untouched if part is already escaped |
| const nsCSubstring& NS_EscapeURL | ( | const nsCSubstring & | str, | |
| PRUint32 | flags, | |||
| nsCSubstring & | result | |||
| ) | [inline] |
String friendly versions...
| PRInt32 NS_UnescapeURL | ( | char * | str | ) | [inline] |
returns resultant string length
| const nsCSubstring& NS_UnescapeURL | ( | const nsCSubstring & | str, | |
| PRUint32 | flags, | |||
| nsCSubstring & | result | |||
| ) | [inline] |
| PRBool NS_UnescapeURL | ( | const char * | str, | |
| PRInt32 | len, | |||
| PRUint32 | flags, | |||
| nsACString & | result | |||
| ) |
Expands URL escape sequences...
beware embedded null bytes!
| str | url string to unescape | |
| len | length of |str| | |
| flags | only esc_OnlyNonASCII, esc_SkipControl and esc_AlwaysCopy are recognized | |
| result | result buffer, untouched if |str| is already unescaped |
| nsCString& NS_UnescapeURL | ( | nsCString & | str | ) | [inline] |
Inline unescape of mutable string object.
| char* nsEscape | ( | const char * | str, | |
| nsEscapeMask | mask | |||
| ) |
Escape the given string according to mask.
| str | The string to escape | |
| mask | How to escape the string |
| char* nsEscapeHTML | ( | const char * | string | ) |
| char* nsUnescape | ( | char * | str | ) |
| PRInt32 nsUnescapeCount | ( | char * | str | ) |
1.7.1