| Qore Programming Language Reference Manual 1.8.1

Pseudo_QC_String.dox.h
1
3 namespace Qore {
5 /***/
6 class <string> : public <value> {
7
8 public:
10
26 int comparePartial(string ostr);
27
28 public:
30
42 bool empty();
43
44 public:
46
58 string encoding();
59
60 public:
62
79 bool equalPartial(string ostr);
80
81 public:
83
99 bool equalPartialPath(string ostr);
100
101 public:
103
131 int find(softstring substr, softint pos = 0);
132
133 public:
135
146 string getDecoded(int code = CD_ALL);
147
148 public:
150
161 string getEncoded(int code = CE_XHTML);
162
163 public:
165
189 *string getLine(int offset = 0, *string eol, bool trim = True, *reference<int> size);
190
191 public:
193
207 int getUnicode(int offset = 0);
208
209 public:
211
222 bool intp();
223
224 public:
226
238 bool isDataAscii();
239
240 public:
242
255 bool isDataPrintableAscii();
256
257 public:
259
278 int length();
279
280 public:
282
305 string lwr();
306
307 public:
309
336 bool regex(string regex, int options = 0);
337
338 public:
340
372 *list<*string> regexExtract(string regex, int options = 0);
373
374 public:
376
404 int rfind(softstring substr, softint pos = -1);
405
406 public:
408
427 int size();
428
429 public:
431
440 bool sizep();
441
442 public:
444
464 list<string> split(string sep, bool with_separator = False);
465
466 public:
468
504 list<string> split(string sep, string quote, bool trim_unquoted = False);
505
506 public:
508
533 list<string> splitRegex(string regex_sep, int options = 0, bool with_separator = False);
534
535 public:
537
561 list<string> splitRegex(string regex_sep, bool with_separator = False);
562
563 public:
565
584 int strlen();
585
586 public:
588
599 bool strp();
600
601 public:
603
622 string substr(softint start);
623
624 public:
626
648 string substr(softint start, softint len);
649
650 public:
652
673 string toBase64(softint maxlinelen = -1);
674
675 public:
677
691 binary toBinary();
692
693 public:
695
711 string toHex();
712
713 public:
715
749 int toInt(int base = 10);
750
751 public:
753
778 string toMD5();
779
780 public:
782
804 string toSHA1();
805
806 public:
808
834 string toSHA224();
835
836 public:
838
864 string toSHA256();
865
866 public:
868
896 string toSHA384();
897
898 public:
900
928 string toSHA512();
929
930 public:
932
946 int typeCode();
947
948 public:
950
965 string unaccent();
966
967 public:
969
992 string upr();
993
994 public:
996
1006 bool val();
1007
1008 public:
1010
1033 int width();
1034 };
1035 }
<string>
Methods in this pseudo-class can be executed on strings.
Definition: Pseudo_QC_String.dox.h:6
<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>::upr
string upr()
Returns the string in upper case.
<string>::toSHA256
string toSHA256()
Returns the SHA-256 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>::equalPartial
bool equalPartial(string ostr)
Compares the beginning of the current string with a shorter string passed as an argument for equality...
<string>::unaccent
string unaccent()
Returns a string with all accented characters removed.
<string>::strlen
int strlen()
Returns the number of bytes in the string (not including the terminating null character ('\0')
<string>::width
int width()
Returns the width of characters in the string; some unicode characters take up multiple spaces on out...
<string>::toMD5
string toMD5()
Returns the MD5 message digest of the string as a hex string.
<string>::toSHA224
string toSHA224()
Returns the SHA-224 message digest (a variant of SHA-2) of the string as a hex string.
<string>::split
list< string > split(string sep, string quote, bool trim_unquoted=False)
Splits a string into a list of components based on a separator string and a quote character.
<string>::regex
bool regex(string regex, int options=0)
Returns True if the regular expression matches the string passed, otherwise returns False.
<string>::typeCode
int typeCode()
Returns Qore::NT_STRING.
<string>::getEncoded
string getEncoded(int code=CE_XHTML)
returns a string based on the string value with encodings as per the code argument
<string>::find
int find(softstring substr, softint pos=0)
Retrieves the character position of a substring within a string.
<string>::length
int length()
Returns the number of characters in the string; may not be equal to the byte length (returned by Qore...
<string>::toSHA1
string toSHA1()
Returns the SHA1 message digest of the string as a hex string.
<string>::encoding
string encoding()
Returns the name of the string's character encoding.
<string>::empty
bool empty()
Returns True if the string is empty, False if not.
<string>::val
bool val()
Returns False if the string is empty, True if not.
<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>::strp
bool strp()
Returns True by default.
<string>::toBinary
binary toBinary()
Returns a binary value with the string's data.
<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>::substr
string substr(softint start, softint len)
Returns a portion of a string starting from an integer offset, with a length parameter.
<string>::comparePartial
int comparePartial(string ostr)
Compares the beginning of the current string with a shorter string passed as an argument,...
<string>::size
int size()
Returns the number of bytes in the string (not including the terminating null character ('\0')
<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>::sizep
bool sizep()
Returns True since strings can return a non-zero size.
<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>::getUnicode
int getUnicode(int offset=0)
returns the Unicode code for the given character offset in the string
<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>::lwr
string lwr()
Returns the string in lower case.
<string>::splitRegex
list< string > splitRegex(string regex_sep, 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>::toSHA384
string toSHA384()
Returns the SHA-384 message digest (a variant of SHA-2) of the string as a hex string.
<string>::toInt
int toInt(int base=10)
Converts the string to an integer value with respect to the base
<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>::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
<string>::split
list< string > split(string sep, bool with_separator=False)
Splits a string into a list of components based on a separator 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:6
Qore::CD_ALL
const CD_ALL
code for decoding everything
Definition: ql_misc.dox.h:2281
Qore::CE_XHTML
const CE_XHTML
code for encoding XHTML entities
Definition: ql_misc.dox.h:2251
Qore::True
const True
logical True
Definition: qc_qore.dox.h:98
Qore::False
const False
logical False
Definition: qc_qore.dox.h:96
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::binary
binary binary()
Always returns an empty binary object (of zero length)
Qore
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:3