Logo Search packages:      
Sourcecode: condor version File versions  Download package

MyString Class Reference

#include <MyString.h>

Inherited by HashString.

List of all members.


Detailed Description

The MyString class is a C++ representation of a string. It was written before we could reliably use the standard string class. For an example of how to use it, see test_mystring.C.

A warning to anyone changing this code: as currently implemented, an "empty" MyString can have two different possible internal representations depending on its history. Sometimes Data == NULL, sometimes Data[0] == ''. So don't assume one or the other... We should change this to never having NULL, but there is worry that someone depends on this behavior.

Definition at line 38 of file MyString.h.


Appending strings

MyStringoperator+= (double d)
MyStringoperator+= (long l)
MyStringoperator+= (unsigned int ui)
MyStringoperator+= (int i)
MyStringoperator+= (const char)
MyStringoperator+= (const char *s)
MyStringoperator+= (const MyString &S)
MyString operator+ (const MyString &S1, const MyString &S2)

Public Member Functions

bool readLine (FILE *fp, bool append=false)
Miscellaneous functions
void append_to_list (MyString const &str, char const *delim=",")
void append_to_list (char const *str, char const *delim=",")
bool chomp (void)
MyString EscapeChars (const MyString &Q, const char escape) const
int find (const char *pszToFind, int iStartPos=0) const
int FindChar (int Char, int FirstPos=0) const
unsigned int Hash () const
void lower_case (void)
bool replaceString (const char *pszToReplace, const char *pszReplaceWith, int iStartFromPos=0)
bool sprintf (const char *format,...) CHECK_PRINTF_FORMAT(2
bool sprintf_cat (const char *format,...) CHECK_PRINTF_FORMAT(2
void strlwr (void)
void strupr (void)
MyString Substr (int pos1, int pos2) const
void trim (void)
void upper_case (void)
bool bool vsprintf (const char *format, va_list args)
bool bool vsprintf_cat (const char *format, va_list args)
Accessors
int Capacity () const
const char * GetCStr () const
bool IsEmpty () const
int Length () const
const char & operator[] (int pos)
char operator[] (int pos) const
void randomlyGenerate (const char *set, int len)
void randomlyGenerateHex (int len)
void setChar (int pos, char value)
char * StrDup () const
const char * Value () const
Tokenize
const char * GetNextToken (const char *delim, bool skipBlankTokens)
void Tokenize ()
Constructors and Destructors
 MyString (const MyString &S)
 MyString (const char *S)
 MyString (int i)
 MyString ()
 ~MyString ()
Assignment Operators
MyStringoperator= (const char *s)
MyStringoperator= (const MyString &S)
Memory Management
bool reserve (const int sz)
bool reserve_at_least (const int sz)

Private Member Functions

void append_str (const char *s, int s_len)
void assign_str (const char *s, int s_len)
void init ()

Private Attributes

int capacity
char * Data
char dummy
int Len
char * nextToken
char * tokenBuf

Friends

Comparisons
int operator!= (const MyString &S1, const char *S2)
int operator!= (const MyString &S1, const MyString &S2)
int operator< (const MyString &S1, const MyString &S2)
int operator<= (const MyString &S1, const MyString &S2)
int operator== (const MyString &S1, const char *S2)
int operator== (const MyString &S1, const MyString &S2)
int operator> (const MyString &S1, const MyString &S2)
int operator>= (const MyString &S1, const MyString &S2)

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index