| Qore Programming Language Reference Manual 1.0.8

Pseudo_QC_String.dox.h
1
3 namespace Qore {
5 /***/
6 class <string> : public <value> {
7
8 public:
10
24 int comparePartial(string ostr);
25
26 public:
28
40 bool empty();
41
42 public:
44
56 string encoding();
57
58 public:
60
76 bool equalPartial(string ostr);
77
78 public:
80
94 bool equalPartialPath(string ostr);
95
96 public:
98
126 int find(softstring substr, softint pos = 0);
127
128 public:
130
141 string getDecoded(int code = CD_ALL);
142
143 public:
145
156 string getEncoded(int code = CE_XHTML);
157
158 public:
160
177 *string getLine(int offset = 0, *string eol, bool trim = True, *reference<int> size);
178
179 public:
181
195 int getUnicode(int offset = 0);
196
197 public:
199
210 bool intp();
211
212 public:
214
226 bool isDataAscii();
227
228 public:
230
242 bool isDataPrintableAscii();
243
244 public:
246
265 int length();
266
267 public:
269
292 string lwr();
293
294 public:
296
323 bool regex(string regex, int options = 0);
324
325 public:
327
359 *list<*string> regexExtract(string regex, int options = 0);
360
361 public:
363
391 int rfind(softstring substr, softint pos = -1);
392
393 public:
395
414 int size();
415
416 public:
418
427 bool sizep();
428
429 public:
431
451 list<string> split(string sep, bool with_separator = False);
452
453 public:
455
483 list<string> split(string sep, string quote, bool trim_unquoted = False);
484
485 public:
487
512 list<string> splitRegex(string regex_sep, int options = 0, bool with_separator = False);
513
514 public:
516
540 list<string> splitRegex(string regex_sep, bool with_separator = False);
541
542 public:
544
563 int strlen();
564
565 public:
567
578 bool strp();
579
580 public:
582
601 string substr(softint start);
602
603 public:
605
627 string substr(softint start, softint len);
628
629 public:
631
651 string toBase64(softint maxlinelen = -1);
652
653 public:
655
669 binary toBinary();
670
671 public:
673
689 string toHex();
690
691 public:
693
725 int toInt(int base = 10);
726
727 public:
729
753 string toMD5();
754
755 public:
757
779 string toSHA1();
780
781 public:
783
809 string toSHA224();
810
811 public:
813
839 string toSHA256();
840
841 public:
843
869 string toSHA384();
870
871 public:
873
899 string toSHA512();
900
901 public:
903
917 int typeCode();
918
919 public:
921
936 string unaccent();
937
938 public:
940
963 string upr();
964
965 public:
967
977 bool val();
978
979 public:
981
1004 int width();
1005 };
1006 }
<string>::substr
string substr(softint start)
Returns a portion of a string starting from an integer offset.
<string>::regexExtract
*list< *string > regexExtract(string regex, int options=0)
Returns a list of substrings in a string based on matching patterns defined by a regular expression...
<string>::toSHA224
string toSHA224()
Returns the SHA-224 message digest (a variant of SHA-2) of the string as a hex string.
<string>::toBase64
string toBase64(softint maxlinelen=-1)
Returns the base64-encoded representation of the string.
<string>::comparePartial
int comparePartial(string ostr)
Compares the beginning of the current string with a shorter string passed as an argument, returns -1, 0, or 1 if the argument string is less than, equal, or greater than the beginning of the current string; returns also -1 if the argument string is equal to the beginning of the current string but the argument string is longer than the current string.
<string>::toSHA1
string toSHA1()
Returns the SHA1 message digest of the string as a hex string.
<string>::find
int find(softstring substr, softint pos=0)
Retrieves the character position of a substring within a string.
<string>::isDataAscii
bool isDataAscii()
returns True if the string is empty or has no characters with the high bit set (ie all characters < 1...
<string>::getLine
*string getLine(int offset=0, *string eol, bool trim=True, *reference< int > size)
returns a string for the next line in the string buffer starting at the given offset (or at the begin...
<string>::encoding
string encoding()
Returns the name of the string&#39;s character encoding.
<value>
Methods in this pseudo-class are available to be executed on any value type (even NOTHING); this is t...
Definition: Pseudo_QC_All.dox.h:6
<string>::equalPartial
bool equalPartial(string ostr)
Compares the beginning of the current string with a shorter string passed as an argument for equality...
Qore::trim
string trim(string str, *string chars)
Removes byte characters from the start and end of a string and returns the new string (also see the t...
Qore::True
const True
logical True
Definition: qc_qore.dox.h:98
<string>
Methods in this pseudo-class can be executed on strings.
Definition: Pseudo_QC_String.dox.h:6
<string>::empty
bool empty()
Returns True if the string is empty, False if not.
Qore::CE_XHTML
const CE_XHTML
code for encoding XHTML entities
Definition: ql_misc.dox.h:2149
<string>::toSHA384
string toSHA384()
Returns the SHA-384 message digest (a variant of SHA-2) of the string as a hex string.
<string>::sizep
bool sizep()
Returns True since strings can return a non-zero size.
Qore::binary
binary binary()
Always returns an empty binary object (of zero length)
<string>::splitRegex
list< string > splitRegex(string regex_sep, int options=0, bool with_separator=False)
Splits a string into a list of components based on a separator regular expression.
<string>::isDataPrintableAscii
bool isDataPrintableAscii()
returns True if the string is empty or only contains printable non-control ASCII characters (ie all c...
<string>::split
list< string > split(string sep, bool with_separator=False)
Splits a string into a list of components based on a separator string.
<string>::strp
bool strp()
Returns True by default.
<string>::equalPartialPath
bool equalPartialPath(string ostr)
Compares the beginning of the current string assumed to be a path with a shorter string passed as an ...
Qore::False
const False
logical False
Definition: qc_qore.dox.h:96
<string>::getEncoded
string getEncoded(int code=CE_XHTML)
returns a string based on the string value with encodings as per the code argument ...
<string>::lwr
string lwr()
Returns the string in lower case.
<string>::unaccent
string unaccent()
Returns a string with all accented characters removed.
<string>::intp
bool intp()
Returns True if the string can be converted to an integer, False if not, this depends on the first (o...
<value>::toInt
int toInt()
Returns the integer representation of the value; the default is 0.
<string>::upr
string upr()
Returns the string in upper case.
<string>::strlen
int strlen()
Returns the number of bytes in the string (not including the terminating null character (&#39;\0&#39;) ...
<string>::val
bool val()
Returns False if the string is empty, True if not.
<string>::regex
bool regex(string regex, int options=0)
Returns True if the regular expression matches the string passed, otherwise returns False...
<string>::length
int length()
Returns the number of characters in the string; may not be equal to the byte length (returned by Qore...
<string>::getDecoded
string getDecoded(int code=CD_ALL)
returns a string based on the string value, decoded as per the code argument
<string>::toSHA512
string toSHA512()
Returns the SHA-512 message digest (a variant of SHA-2) of the string as a hex string.
<string>::toMD5
string toMD5()
Returns the MD5 message digest of the string as a hex string.
<string>::width
int width()
Returns the width of characters in the string; some unicode characters take up multiple spaces on out...
<string>::getUnicode
int getUnicode(int offset=0)
returns the Unicode code for the given character offset in the string
<string>::size
int size()
Returns the number of bytes in the string (not including the terminating null character (&#39;\0&#39;) ...
Qore::CD_ALL
const CD_ALL
code for decoding everything
Definition: ql_misc.dox.h:2179
Qore
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:3
<string>::typeCode
int typeCode()
Returns Qore::NT_STRING.
<string>::toSHA256
string toSHA256()
Returns the SHA-256 message digest (a variant of SHA-2) of the string as a hex string.
<string>::toBinary
binary toBinary()
Returns a binary value with the string&#39;s data.
<string>::rfind
int rfind(softstring substr, softint pos=-1)
Retrieves the character position of a substring within a string, starting the search from the end of ...
<string>::toHex
string toHex()
returns a string of hexadecimal digits corresponding to the contents of the string ...