GDCM  2.2.6
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
gdcm::CodeString Class Reference

CodeString This is an implementation of DICOM VR: CS The cstor will properly Trim so that operator== is correct. More...

#include <gdcmCodeString.h>

Public Types

typedef
InternalClass::const_iterator 
const_iterator
 
typedef
InternalClass::const_reference 
const_reference
 
typedef
InternalClass::const_reverse_iterator 
const_reverse_iterator
 
typedef
InternalClass::difference_type 
difference_type
 
typedef InternalClass::iterator iterator
 
typedef InternalClass::pointer pointer
 
typedef InternalClass::reference reference
 
typedef
InternalClass::reverse_iterator 
reverse_iterator
 
typedef InternalClass::size_type size_type
 
typedef InternalClass::value_type value_type
 

Public Member Functions

 CodeString ()
 CodeString constructors. More...
 
 CodeString (const value_type *s)
 
 CodeString (const value_type *s, size_type n)
 
 CodeString (const InternalClass &s, size_type pos=0, size_type n=InternalClass::npos)
 
std::string GetAsString () const
 Return the full code string as std::string. More...
 
bool IsValid () const
 Check if CodeString obj is correct.. More...
 
size_type Size () const
 Return the size of the string. More...
 

Protected Member Functions

std::string TrimInternal () const
 

Friends

bool operator!= (const CodeString &ref, const CodeString &cs)
 
std::ostream & operator<< (std::ostream &os, const CodeString &str)
 
bool operator== (const CodeString &ref, const CodeString &cs)
 

Detailed Description

CodeString This is an implementation of DICOM VR: CS The cstor will properly Trim so that operator== is correct.

Note
the cstor of CodeString will Trim the string on the fly so as to remove the extra leading and ending spaces. However it will not perform validation on the fly (CodeString obj can contains invalid char such as lower cases). This design was chosen to be a little tolerant to broken DICOM implementation, and thus allow user to compare lower case CS from there input file without the need to first rewrite them to get rid of invalid character (validation is a different operation from searching, querying).
Warning
when writing out DICOM file it is highly recommended to perform the IsValid() call, at least to check that the length of the string match the definition in the standard.

Member Typedef Documentation

Constructor & Destructor Documentation

gdcm::CodeString::CodeString ( )
inline

CodeString constructors.

gdcm::CodeString::CodeString ( const value_type s)
inline
gdcm::CodeString::CodeString ( const value_type s,
size_type  n 
)
inline
gdcm::CodeString::CodeString ( const InternalClass s,
size_type  pos = 0,
size_type  n = InternalClass::npos 
)
inline

Member Function Documentation

std::string gdcm::CodeString::GetAsString ( ) const
inline

Return the full code string as std::string.

bool gdcm::CodeString::IsValid ( ) const

Check if CodeString obj is correct..

size_type gdcm::CodeString::Size ( ) const
inline

Return the size of the string.

std::string gdcm::CodeString::TrimInternal ( ) const
inlineprotected

Friends And Related Function Documentation

bool operator!= ( const CodeString ref,
const CodeString cs 
)
friend
std::ostream& operator<< ( std::ostream &  os,
const CodeString str 
)
friend
bool operator== ( const CodeString ref,
const CodeString cs 
)
friend

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

Generated on Sat Dec 21 2013 05:56:20 for GDCM by doxygen 1.8.5
SourceForge.net Logo