G4SubString Class Reference

#include <G4String.hh>


Public Member Functions

 G4SubString (const G4SubString &)
G4SubStringoperator= (const char *)
G4SubStringoperator= (const G4String &)
G4SubStringoperator= (const G4SubString &)
char & operator() (str_size)
char operator() (str_size) const
char & operator[] (str_size)
char operator[] (str_size) const
G4int operator! () const
G4bool operator== (const G4String &) const
G4bool operator== (const char *) const
G4bool operator!= (const G4String &) const
G4bool operator!= (const char *) const
str_size length () const
str_size start () const
G4bool isNull () const

Friends

class G4String


Detailed Description

Definition at line 61 of file G4String.hh.


Constructor & Destructor Documentation

G4SubString::G4SubString ( const G4SubString  )  [inline]

Definition at line 40 of file G4String.icc.

00041   : mystring(str.mystring), mystart(str.mystart), extent(str.extent)
00042 {
00043 }


Member Function Documentation

G4bool G4SubString::isNull (  )  const [inline]

Definition at line 124 of file G4String.icc.

00125 {
00126   return (extent==0);
00127 }

str_size G4SubString::length (  )  const [inline]

Definition at line 114 of file G4String.icc.

Referenced by operator=().

00115 {
00116   return extent;
00117 }

G4int G4SubString::operator! (  )  const [inline]

Definition at line 89 of file G4String.icc.

00090 {
00091   return (extent==0) ? 1 : 0;
00092 }

G4bool G4SubString::operator!= ( const char *   )  const [inline]

Definition at line 109 of file G4String.icc.

00110 {
00111   return (mystring->find(str,mystart,extent) == std::string::npos);
00112 }

G4bool G4SubString::operator!= ( const G4String  )  const [inline]

Definition at line 104 of file G4String.icc.

00105 {
00106   return (mystring->find(str,mystart,extent) == std::string::npos);
00107 }

char G4SubString::operator() ( str_size   )  const [inline]

Definition at line 74 of file G4String.icc.

00075 {
00076   return mystring->operator[](mystart+i);
00077 }

char & G4SubString::operator() ( str_size   )  [inline]

Definition at line 69 of file G4String.icc.

00070 {
00071   return mystring->operator[](mystart+i);
00072 }

G4SubString & G4SubString::operator= ( const G4SubString  )  [inline]

Definition at line 55 of file G4String.icc.

References G4String::data(), length(), mystring, and G4String::replace().

00056 {
00057   mystring->replace(mystart,extent,str.mystring->data(),str.length());
00058   extent=str.length();
00059   return *this;
00060 }

G4SubString & G4SubString::operator= ( const G4String  )  [inline]

Definition at line 50 of file G4String.icc.

References operator=().

00051 {
00052   return operator=(str);
00053 }

G4SubString & G4SubString::operator= ( const char *   )  [inline]

Definition at line 62 of file G4String.icc.

References G4String::replace().

Referenced by operator=().

00063 {
00064   mystring->replace(mystart,extent,str,strlen(str));
00065   extent=strlen(str);
00066   return *this;
00067 }

G4bool G4SubString::operator== ( const char *   )  const [inline]

Definition at line 99 of file G4String.icc.

00100 {
00101   return (mystring->find(str,mystart,extent) != std::string::npos);
00102 }

G4bool G4SubString::operator== ( const G4String  )  const [inline]

Definition at line 94 of file G4String.icc.

00095 {
00096   return (mystring->find(str,mystart,extent) != std::string::npos);
00097 }

char G4SubString::operator[] ( str_size   )  const [inline]

Definition at line 84 of file G4String.icc.

00085 {
00086   return mystring->operator[](mystart+i);
00087 }

char & G4SubString::operator[] ( str_size   )  [inline]

Definition at line 79 of file G4String.icc.

00080 {
00081   return mystring->operator[](mystart+i);
00082 }

str_size G4SubString::start (  )  const [inline]

Definition at line 119 of file G4String.icc.

00120 {
00121   return mystart;
00122 }


Friends And Related Function Documentation

friend class G4String [friend]

Definition at line 99 of file G4String.hh.


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:53:27 2013 for Geant4 by  doxygen 1.4.7