Qore Programming Language Reference Manual  0.9.4.1
Pseudo_QC_String.dox.h
1 namespace Qore {
4 /***/
5 class <string> : public <value> {
6 
7 public:
9 
23 int comparePartial(string ostr);
24 
25 public:
27 
39 bool empty();
40 
41 public:
43 
55 string encoding();
56 
57 public:
59 
75 bool equalPartial(string ostr);
76 
77 public:
79 
93 bool equalPartialPath(string ostr);
94 
95 public:
97 
125 int find(softstring substr, softint pos = 0);
126 
127 public:
129 
140 string getDecoded(int code = CD_ALL);
141 
142 public:
144 
155 string getEncoded(int code = CE_XHTML);
156 
157 public:
159 
176 *string getLine(int offset = 0, *string eol, bool trim = True, *reference<int> size);
177 
178 public:
180 
194 int getUnicode(int offset = 0);
195 
196 public:
198 
209 bool intp();
210 
211 public:
213 
225 bool isDataAscii();
226 
227 public:
229 
241 bool isDataPrintableAscii();
242 
243 public:
245 
263 int length();
264 
265 public:
267 
290 string lwr();
291 
292 public:
294 
319 bool regex(string regex, int options = 0);
320 
321 public:
323 
351 *list<*string> regexExtract(string regex, int options = 0);
352 
353 public:
355 
383 int rfind(softstring substr, softint pos = -1);
384 
385 public:
387 
405 int size();
406 
407 public:
409 
418 bool sizep();
419 
420 public:
422 
442 list<string> split(string sep, bool with_separator = False);
443 
444 public:
446 
473 list<string> split(string sep, string quote, bool trim_unquoted = False);
474 
475 public:
477 
493 int strlen();
494 
495 public:
497 
508 bool strp();
509 
510 public:
512 
531 string substr(softint start);
532 
533 public:
535 
557 string substr(softint start, softint len);
558 
559 public:
561 
581 string toBase64(softint maxlinelen = -1);
582 
583 public:
585 
599 binary toBinary();
600 
601 public:
603 
619 string toHex();
620 
621 public:
623 
655 int toInt(int base = 10);
656 
657 public:
659 
683 string toMD5();
684 
685 public:
687 
709 string toSHA1();
710 
711 public:
713 
739 string toSHA224();
740 
741 public:
743 
769 string toSHA256();
770 
771 public:
773 
799 string toSHA384();
800 
801 public:
803 
829 string toSHA512();
830 
831 public:
833 
847 int typeCode();
848 
849 public:
851 
866 string unaccent();
867 
868 public:
870 
893 string upr();
894 
895 public:
897 
907 bool val();
908 };
909 };
<string>::toSHA224
string toSHA224()
Returns the SHA-224 message digest (a variant of SHA-2) of the string as a hex string.
Qore::CD_ALL
const CD_ALL
code for decoding everything
Definition: ql_misc.dox.h:2179
<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>::substr
string substr(softint start)
Returns a portion of a string starting from an integer offset.
<string>::encoding
string encoding()
Returns the name of the string's character encoding.
Qore::CE_XHTML
const CE_XHTML
code for encoding XHTML entities
Definition: ql_misc.dox.h:2149
<string>::isDataPrintableAscii
bool isDataPrintableAscii()
returns True if the string is empty or only contains printable non-control ASCII characters (ie all c...
<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 ...
<string>::getEncoded
string getEncoded(int code=CE_XHTML)
returns a string based on the string value with encodings as per the code argument
<string>::empty
bool empty()
Returns True if the string is empty, False if not.
<string>::intp
bool intp()
Returns True if the string can be converted to an integer, False if not, this depends on the first (o...
<string>::equalPartial
bool equalPartial(string ostr)
Compares the beginning of the current string with a shorter string passed as an argument for equality...
<string>::toBase64
string toBase64(softint maxlinelen=-1)
Returns the base64-encoded representation of the string.
<string>::sizep
bool sizep()
Returns True since strings can return a non-zero size.
<string>::comparePartial
int comparePartial(string ostr)
Compares the beginning of the current string with a shorter string passed as an argument,...
<string>::find
int find(softstring substr, softint pos=0)
Retrieves the character position of a substring within a string.
<string>::strlen
int strlen()
Returns the number of bytes in the string (not including the terminating null character ('\0')
Qore::True
const True
logical True
Definition: qc_qore.dox.h:98
<string>::upr
string upr()
Returns the string in upper case.
<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>::length
int length()
Returns the number of characters in the string; may not be equal to the byte length (returned by Qore...
<string>::toSHA384
string toSHA384()
Returns the SHA-384 message digest (a variant of SHA-2) of the string as a hex string.
<string>::lwr
string lwr()
Returns the string in lower case.
<string>::unaccent
string unaccent()
Returns a string with all accented characters removed.
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...
<string>::toSHA512
string toSHA512()
Returns the SHA-512 message digest (a variant of SHA-2) of the string as a hex string.
<string>::regex
bool regex(string regex, int options=0)
Returns True if the regular expression matches the string passed, otherwise returns False.
<string>::val
bool val()
Returns False if the string is empty, True if not.
<value>::toInt
int toInt()
Returns the integer representation of the value; the default is 0.
<string>::toMD5
string toMD5()
Returns the MD5 message digest of the string as a hex string.
<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:5
<string>
Methods in this pseudo-class can be executed on strings.
Definition: Pseudo_QC_String.dox.h:5
<string>::toBinary
binary toBinary()
Returns a binary value with the string's data.
Qore::False
const False
logical False
Definition: qc_qore.dox.h:96
<string>::size
int size()
Returns the number of bytes in the string (not including the terminating null character ('\0')
<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>::getDecoded
string getDecoded(int code=CD_ALL)
returns a string based on the string value, decoded as per the code argument
<string>::toSHA256
string toSHA256()
Returns the SHA-256 message digest (a variant of SHA-2) of the string as a hex string.
<string>::getUnicode
int getUnicode(int offset=0)
returns the Unicode code for the given character offset in the string
<string>::typeCode
int typeCode()
Returns Qore::NT_STRING.
Qore
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:2
<string>::toHex
string toHex()
returns a string of hexadecimal digits corresponding to the contents of the string
<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>::toSHA1
string toSHA1()
Returns the SHA1 message digest of the string as a hex 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...
Qore::binary
binary binary()
Always returns an empty binary object (of zero length)