string.icc File Reference

#include <iostream>
#include <string.h>

Go to the source code of this file.

Data Structures

struct  string
struct  string::srep

Functions

string operator+ (char a, const string &b)
string operator+ (const char *a, const string &b)
string operator+ (const string &a, const char *b)
string operator+ (const string &a, const string &b)
bool operator== (const string &x, const char *s)
bool operator== (const string &x, const string &y)
bool operator!= (const string &x, const char *s)
bool operator!= (const string &x, const string &y)
std::ostream & operator<< (std::ostream &s, const string &x)


Function Documentation

bool operator!= ( const string x,
const string y 
) [inline]

Definition at line 114 of file string.icc.

References string::p, and string::srep::s.

00114                                                            {
00115   return strcmp(x.p->s, y.p->s) != 0;
00116 }

bool operator!= ( const string x,
const char *  s 
) [inline]

Definition at line 111 of file string.icc.

References string::p, and string::srep::s.

00111                                                         {
00112   return strcmp(x.p->s, s) != 0;
00113 }

string operator+ ( const string a,
const string b 
) [inline]

Definition at line 95 of file string.icc.

References string::c_str().

00095                                                             {
00096   int lena = strlen(a.c_str());
00097   string s; s.p->s = new char[lena+strlen(b.c_str())+1];
00098   strcpy(s.p->s, a.c_str()); strcpy(s.p->s+lena, b.c_str());
00099   return s;
00100 }

string operator+ ( const string a,
const char *  b 
) [inline]

Definition at line 88 of file string.icc.

References string::c_str().

00088                                                           {
00089   int lena = strlen(a.c_str());
00090   string s; s.p->s = new char[lena+strlen(b)+1];
00091   strcpy(s.p->s, a.c_str()); strcpy(s.p->s+lena, b);
00092   return s;
00093 }

string operator+ ( const char *  a,
const string b 
) [inline]

Definition at line 81 of file string.icc.

References string::c_str(), string::p, and string::srep::s.

00081                                                           {
00082   int lena = strlen(a);
00083   string s; s.p->s = new char[lena+strlen(b.c_str())+1];
00084   strcpy(s.p->s, a); strcpy(s.p->s+lena, b.c_str());
00085   return s;
00086 }

string operator+ ( char  a,
const string b 
) [inline]

Definition at line 75 of file string.icc.

References string::c_str(), string::p, and string::srep::s.

00075                                                   {
00076   string s; s.p->s = new char[strlen(b.c_str())+2];
00077   s.p->s[0] = a; strcpy(s.p->s+1, b.c_str());
00078   return s;
00079 }

std::ostream& operator<< ( std::ostream &  s,
const string x 
)

Definition at line 121 of file string.icc.

References string::p, and string::srep::s.

00121                                                           {
00122   return s << x.p->s;
00123 } 

bool operator== ( const string x,
const string y 
) [inline]

Definition at line 108 of file string.icc.

References string::p, and string::srep::s.

00108                                                            {
00109   return strcmp(x.p->s, y.p->s) == 0;
00110 }

bool operator== ( const string x,
const char *  s 
) [inline]

Definition at line 105 of file string.icc.

References string::p, and string::srep::s.

00105                                                         {
00106   return strcmp(x.p->s, s) == 0;
00107 }


Generated on Mon May 27 17:51:16 2013 for Geant4 by  doxygen 1.4.7