UCommon
Data Structures | Namespaces | Defines | Typedefs | Functions
ucommon/string.h File Reference

A common string class and character string support functions. More...

#include <ucommon/cpr.h>
#include <ucommon/generics.h>
#include <ucommon/protocols.h>
#include <ucommon/object.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
Include dependency graph for string.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  ucommon::charbuf< S >
 A template to create a character array that can be manipulated as a string. More...
class  ucommon::memstring
 A string class that uses a cstring buffer that is fixed in memory. More...
class  ucommon::string
 A copy-on-write string class that operates by reference count. More...
class  ucommon::string::cstring
 This is an internal class which contains the actual string data along with some control fields. More...
class  ucommon::stringbuf< S >
 A string class that has a predefined string buffer. More...

Namespaces

namespace  ucommon
 

Common namespace for all ucommon objects.


Defines

#define MIME_B64_WIDTH   76
#define PGP_B64_WIDTH   64

Typedefs

typedef string ucommon::String
 A convenience type when mixing std::string in old compilers that are bad with namespaces...
typedef string ucommon::string_t
 A convenience type for string.
typedef unsigned short ucommon::strsize_t
 A convenience class for size of strings.

Functions

bool ucommon::case_eq (char *s1, char *s2)
 Compare two null terminated strings if equal ignoring case.
bool ucommon::case_eq (char *s1, char *s2, size_t size)
 Compare two null terminated strings if equal for a specified size ignoring case.
bool ucommon::eq (char *s1, char *s2)
 Compare two null terminated strings if equal.
bool ucommon::eq (char *s1, char *s2, size_t size)
 Compare two null terminated strings if equal up to specified size.
bool ucommon::eq (String &s1, String &s2)
 Compare two string objects if equal.
bool ucommon::ieq (char *s1, char *s2)
bool ucommon::ieq (char *s1, char *s2, size_t size)
bool ucommon::ieq (String &s1, String &s2)
 Compare two string objects if equal ignoring case.
String ucommon::str (char *string)
String ucommon::str (String &string)
String ucommon::str (short value)
String ucommon::str (unsigned short value)
String ucommon::str (long value)
String ucommon::str (unsigned long value)
String ucommon::str (double value)
String ucommon::str (CharacterProtocol &cp, strsize_t size)
int ucommon::stricmp (char *string1, char *string2)
 Convenience function for case insensitive null terminated string compare.
int ucommon::strnicmp (char *string1, char *string2, size_t max)
 Convenience function for case insensitive null terminated string compare.
template<>
void ucommon::swap< string_t > (string_t &s1, string_t &s2)

Detailed Description

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.