|
Sharkysoft home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--lava.string.StringDecoder
Decodes strings.
Details: StringEncoder contains functions for transforming encoded strings into regular strings.
Constructor Summary | |
StringDecoder()
|
Method Summary | |
static java.lang.String |
decodeCString(java.lang.String s)
Details: decodeCString decodes a C-style string that may contain backslash- |
static java.lang.String |
decodeHtmlText(java.lang.String encoded)
Decodes HTML-encoded string. |
static java.lang.String |
decodeQuotedCString(java.lang.String s)
Decodes quoted C string. |
static int |
digitForChar(char c)
Converts digit character to value. |
static byte[] |
hexStringToBytes(java.lang.String s)
Coverts hex string to bytes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StringDecoder()
Method Detail |
public static final java.lang.String decodeCString(java.lang.String s)
Details: decodeCString decodes a C-style string that may contain backslash-
The following characters have special interpretations when preceded by a backslash:
'a', 'b', 'f', 'n', 'r', 't', 'v', 'x'
Other characters preceded by a backslash are taken to be themselves. (Hence, "\?" converts to just "?".) Consult your favorite C text for more information on C string literals.
s
- the C-style string to decodepublic static java.lang.String decodeQuotedCString(java.lang.String s)
Details: decodeQuotedCString decodes a quoted C string literal using the common rules of C. If the string does not begin and end with single or double quotes, or if it begins and ends with mismatching quote types, null is returned. Otherwise, the quotes are trimmed and what's left is passed to decodeCString.
s
- the quoted stringpublic static int digitForChar(char c)
Details: digitForChar returns the value that would represented by the given character if the radix allowed it. For '0'-'9', digitForChar returns 0-9; for 'A(a)'-'Z(z)', digitForChar returns 10-35. All other characters are illegal.
c
- the character digitpublic static byte[] hexStringToBytes(java.lang.String s)
Details: hexStringToBytes
converts an even-byte
s. This operation fails if the string is null
, the length of the string is odd, or the string contains non-null
is returned on failure.
s
- the stringpublic static java.lang.String decodeHtmlText(java.lang.String encoded)
Details: decodeHtmlText converts an HTML-encoded string (encode) into a natural string by decoding all of the HTML entities contained within the string.
the
- encoded string
|
Sharkysoft home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |