ucommon
|
A common string class and character string support functions. More...
#include <ucommon/platform.h>
#include <ucommon/protocols.h>
#include <ucommon/object.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
Go to the source code of this file.
Data Structures | |
class | charbuf< S > |
A template to create a character array that can be manipulated as a string. More... | |
class | memstring |
A string class that uses a cstring buffer that is fixed in memory. More... | |
class | string |
A copy-on-write string class that operates by reference count. More... | |
class | string::cstring |
This is an internal class which contains the actual string data along with some control fields. More... | |
class | stringbuf< S > |
A string class that has a predefined string buffer. More... | |
Typedefs | |
typedef string | String |
A convenience type when mixing std::string in old compilers that are bad with namespaces... | |
typedef string | string_t |
A convenience type for string. | |
Functions | |
bool | eq (char const *s1, char const *s2) |
Compare two null terminated strings if equal. | |
bool | eq (char const *s1, char const *s2, size_t size) |
Compare two null terminated strings if equal up to specified size. | |
bool | eq (String &s1, String &s2) |
Compare two string objects if equal. | |
bool | ieq (String &s1, String &s2) |
Compare two string objects if equal ignoring case. | |
bool | ieq (char const *s1, char const *s2) |
Compare two null terminated strings if equal ignoring case. | |
bool | ieq (char const *s1, char const *s2, size_t size) |
Compare two null terminated strings if equal for a specified size ignoring case. | |
String | str (short value) |
String | str (unsigned long value) |
String | str (const char *string) |
String | str (double value) |
String | str (long value) |
String | str (CharacterProtocol &cp, strsize_t size) |
String | str (String &string) |
String | str (unsigned short value) |
int | stricmp (const char *string1, const char *string2) |
Convenience function for case insensitive null terminated string compare. | |
int | strnicmp (const char *string1, const char *string2, size_t max) |
Convenience function for case insensitive null terminated string compare. | |
Variables | |
NAMESPACE_UCOMMON typedef unsigned short | strsize_t |
A convenience class for size of strings. |
A common string class and character string support functions.
Ucommon offers a simple string class that operates through copy-on-write when needing to expand buffer size. Derived classes and templates allows one to create strings which live entirely in the stack frame rather than using the heap. This offers the benefit of the string class manipulative members without compromising performance or locking issues in threaded applications. Other things found here include better and safer char array manipulation functions.
Definition in file string.h.
bool eq | ( | char const * | s1, |
char const * | s2 | ||
) | [inline] |
bool eq | ( | char const * | s1, |
char const * | s2, | ||
size_t | size | ||
) | [inline] |
bool ieq | ( | char const * | s1, |
char const * | s2 | ||
) | [inline] |
bool ieq | ( | char const * | s1, |
char const * | s2, | ||
size_t | size | ||
) | [inline] |
Compare two null terminated strings if equal for a specified size ignoring case.
This is related to stricmp or gcc strcasecmp.
s1 | string to compare. |
s2 | string to compare. |
size | of string to compare. |
Definition at line 1652 of file string.h.
int stricmp | ( | const char * | string1, |
const char * | string2 | ||
) | [inline] |
int strnicmp | ( | const char * | string1, |
const char * | string2, | ||
size_t | max | ||
) | [inline] |