Next Previous Contents

10. The SSTRING and SSTRINGS objects

10.1 SSTRING Alphabetical function listing

Classe SSTRING, vue publique

10.2 SSTRINGS alphabetical function listing

Classe SSTRINGS, vue publique

10.3 Defining an SSTRING

SSTRING::SSTRING()

        PUBLIC SSTRING::SSTRING(
                void)
        

SSTRING::SSTRING()

        PUBLIC SSTRING::SSTRING(
                const char *_str)
        

SSTRING::SSTRING()

        PUBLIC SSTRING::SSTRING(
                const char *_str,
                int _maxsiz)
        

SSTRING::SSTRING()

        PUBLIC SSTRING::SSTRING(
                const SSTRING&_str)
        

10.4 Setting value and modifying

SSTRING::append()

Append a string to the current content.

        PUBLIC void SSTRING::append(
                const char *app,
                int len2)
        

SSTRING::append()

Append a string to the current content.

        PUBLIC void SSTRING::append(
                const char *app)
        

SSTRING::append()

Append one character to the current content.

        PUBLIC void SSTRING::append(
                const char car)
        

SSTRING::append()

Append a string to the current content.

        PUBLIC void SSTRING::append(
                const SSTRING&s)
        

SSTRING::append()

Append a string to the current content.

        PUBLIC void SSTRING::append(
                const SSTRING *s)
        

SSTRING::appendf()

Does an sprintf, but append the result in the SSTRING. Return the number of bytes stored

        PUBLIC int SSTRING::appendf(
                const char *ctl,
                ...)
        

SSTRING::setfrom()

Initialise the SSTRING from a value. This value may be a substring of the current value of this SSTRING

        PUBLIC VIRTUAL void SSTRING::setfrom(
                const char *src)
        

SSTRING::setfrom()

        PUBLIC void SSTRING::setfrom(
                const SSTRING&src)
        

SSTRING::setfrom()

        PUBLIC void SSTRING::setfrom(
                const char *src,
                int len)
        

SSTRING::setfrom()

Initialise a SSTRING from a integer (convert to ASCII decimal)

        PUBLIC void SSTRING::setfrom(
                int val)
        

SSTRING::setfromf()

Does an sprintf, but store the result in the SSTRING. Return the number of bytes stored

        PUBLIC int SSTRING::setfromf(
                const char *ctl,
                ...)
        

SSTRING::operator=()

        PUBLIC SSTRING&SSTRING::operator =(
                const SSTRING&_str)
        

SSTRING::setempty()

        PUBLIC void SSTRING::setempty(
                void)
        

SSTRING::strip_end()

Cut the white space at the end of the string

        PUBLIC void SSTRING::strip_end(
                void)
        

SSTRING::truncate()

Cut the string if it exceed a given length

        PUBLIC bool SSTRING::truncate(
                int newlen)
        

SSTRING::to_lower()

Turn the string to lower case

        PUBLIC void SSTRING::to_lower(
                void)
        

SSTRING::to_upper()

Turn the string to upper case

        PUBLIC void SSTRING::to_upper(
                void)
        

10.5 extracting values

SSTRING::copy()

        PUBLIC void SSTRING::copy(
                char *dst) const
        
        

SSTRING::copy()

        PUBLIC void SSTRING::copy(
                SSTRING&dst) const
        
        

SSTRING::copyword()

Extract a word (non white space) from a string. Return a pointer to the end of the word in the line.

        PUBLIC char *SSTRING::copyword(
                const char *line)
        

SSTRING::get()

Get the string value. Will never return NULL (only an empty string).

        PUBLIC const char *SSTRING::get(
                void) const
        
        

SSTRING::getlen()

Return the length of the string.

        PUBLIC int SSTRING::getlen(
                void) const
        
        

SSTRING::getmaxsiz()

        PUBLIC int SSTRING::getmaxsiz(
                void) const
        
        

SSTRING::getval()

Return the numerical (integer) value of the SSTRING

        PUBLIC int SSTRING::getval(
                void) const
        
        

SSTRING::getvalf()

Return the numerical (double) value of the SSTRING

        PUBLIC double SSTRING::getvalf(
                void) const
        
        

SSTRING::substr()

Get the sub string after start characters

        PUBLIC SSTRING SSTRING::substr(
                int start) const
        
        

SSTRING::substr()

Get the sub-string starting with start and ending with end (not included)

        PUBLIC SSTRING SSTRING::substr(
                int start,
                int end) const
        

10.6 Various query

SSTRING::cmp()

Perform a strcmp on the string and the other one.

        PUBLIC int SSTRING::cmp(
                const char *other) const
        
        

SSTRING::cmp()

        PUBLIC int SSTRING::cmp(
                const SSTRING&other) const
        
        

SSTRING::icmp()

Perform a stricmp on the string and the other one.

        PUBLIC int SSTRING::icmp(
                const char *other) const
        
        

SSTRING::icmp()

Perform a stricmp on the string and the other one.

        PUBLIC int SSTRING::icmp(
                const SSTRING&other) const
        
        

SSTRING::is_empty()

Return != 0 if the SSTRING is an empty string.

        PUBLIC bool SSTRING::is_empty(
                void) const
        
        

SSTRING::is_filled()

Return true is the SSTRING is not empty

        PUBLIC bool SSTRING::is_filled(
                void) const
        
        

SSTRING::ncmp()

Perform a strncmp on the string and the other one.

        PUBLIC int SSTRING::ncmp(
                const char *other,
                int len) const
        
        

SSTRING::ncmp()

Perform a strncmp on the string and the other one.

        PUBLIC int SSTRING::ncmp(
                const SSTRING&other,
                int len) const
        
        

SSTRING::strchr()

Find the occurence of a character in the string.

        PUBLIC const char *SSTRING::strchr(
                char carac) const
        
        

SSTRING::strrchr()

Find the last occurence of a character in the string.

        PUBLIC const char *SSTRING::strrchr(
                char carac) const
        
        

SSTRING::strstr()

Find the occurence of a string in the string.

        PUBLIC const char *SSTRING::strstr(
                const char *sub) const
        
        

10.7 Misc

CSSTRING::setcomment()

Record the comment part of the CSSTRING

        PUBLIC void CSSTRING::setcomment(
                const SSTRING&com)
        

10.8 SSTRINGS functions

SSTRINGS::getitem()

        PUBLIC SSTRING *SSTRINGS::getitem(
                int no) const
        
        

SSTRINGS::lookup()

Find the occurence of a string in the array. Return -1 if not found or the index if found

        PUBLIC int SSTRINGS::lookup(
                const char *str) const
        
        

SSTRINGS::lookup()

        PUBLIC int SSTRINGS::lookup(
                const SSTRING *str) const
        
        

SSTRINGS::remove_dups()

Remove duplicate strings Assume the array is already sorted.

        PUBLIC void SSTRINGS::remove_dups(
                void)
        

SSTRINGS::remove_empty()

Remove empty line in a string table

        PUBLIC void SSTRINGS::remove_empty(
                void)
        

SSTRINGS::sort()

Sort the array of SSTRING

        PUBLIC void SSTRINGS::sort(
                void)
        

Next Previous Contents