Public Member Functions | Private Member Functions | Private Attributes | List of all members
DotConstString Class Reference

#include <dot.h>

Public Member Functions

 DotConstString ()
 
 ~DotConstString ()
 
 DotConstString (const QCString &s)
 
 DotConstString (const DotConstString &s)
 
const char * data () const
 
bool isEmpty () const
 
void set (const QCString &s)
 

Private Member Functions

DotConstStringoperator= (const DotConstString &)
 

Private Attributes

char * m_str
 

Detailed Description

Minimal constant string class that is thread safe, once initialized.

Definition at line 330 of file dot.h.

Constructor & Destructor Documentation

DotConstString::DotConstString ( )
inline

Definition at line 333 of file dot.h.

333 { m_str=0; }
char * m_str
Definition: dot.h:351
DotConstString::~DotConstString ( )
inline

Definition at line 334 of file dot.h.

334 { delete[] m_str; }
char * m_str
Definition: dot.h:351
DotConstString::DotConstString ( const QCString s)
inline

Definition at line 335 of file dot.h.

335 : m_str(0) { set(s); }
char * m_str
Definition: dot.h:351
static QCString * s
Definition: config.cpp:1042
DotConstString::DotConstString ( const DotConstString s)
inline

Definition at line 336 of file dot.h.

336 : m_str(0) { set(s.data()); }
char * m_str
Definition: dot.h:351
const char * data() const
Definition: dot.h:337

Member Function Documentation

const char* DotConstString::data ( ) const
inline

Definition at line 337 of file dot.h.

337 { return m_str; }
char * m_str
Definition: dot.h:351
bool DotConstString::isEmpty ( ) const
inline

Definition at line 338 of file dot.h.

338 { return m_str==0 || m_str[0]=='\0'; }
char * m_str
Definition: dot.h:351
DotConstString& DotConstString::operator= ( const DotConstString )
private
void DotConstString::set ( const QCString s)
inline

Definition at line 339 of file dot.h.

340  {
341  delete[] m_str;
342  m_str=0;
343  if (!s.isEmpty())
344  {
345  m_str=new char[s.length()+1];
346  qstrcpy(m_str,s.data());
347  }
348  }
bool isEmpty() const
Definition: qcstring.h:189
uint length() const
Definition: qcstring.h:195
const char * data() const
Definition: qcstring.h:207
char * m_str
Definition: dot.h:351
Q_EXPORT char * qstrcpy(char *dst, const char *src)
Definition: qcstring.h:87

Member Data Documentation

char* DotConstString::m_str
private

Definition at line 351 of file dot.h.


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