gdcm::CodeString Class Reference

CodeString. 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.
| CodeString (const InternalClass &s, size_type pos=0, size_type n=InternalClass::npos)
| CodeString (const value_type *s)
| CodeString (const value_type *s, size_type n)
std::string | GetAsString () const
| Return the full code string as std::string.
bool | IsValid () const
| Check if CodeString obj is correct..
size_type | Size () const
| Return the size of the string.

## 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

## const_iterator

typedef InternalClass::const_iterator gdcm::CodeString::const_iterator

## const_reference

typedef InternalClass::const_reference gdcm::CodeString::const_reference

## const_reverse_iterator

typedef InternalClass::const_reverse_iterator gdcm::CodeString::const_reverse_iterator

## difference_type

typedef InternalClass::difference_type gdcm::CodeString::difference_type

## iterator

typedef InternalClass::iterator gdcm::CodeString::iterator

## pointer

typedef InternalClass::pointer gdcm::CodeString::pointer

## reference

typedef InternalClass::reference gdcm::CodeString::reference

## reverse_iterator

typedef InternalClass::reverse_iterator gdcm::CodeString::reverse_iterator

## size_type

typedef InternalClass::size_type gdcm::CodeString::size_type

## value_type

typedef InternalClass::value_type gdcm::CodeString::value_type

## Constructor & Destructor Documentation

## CodeString() [1/4]

gdcm::CodeString::CodeString | ( |  | ) |

inline

CodeString constructors.

Referenced by operator!=, operator<<, and operator==.

## CodeString() [2/4]

gdcm::CodeString::CodeString | ( | const value_type * | s | ) |

inline

## CodeString() [3/4]

gdcm::CodeString::CodeString | ( | const value_type * | s,
|  | size_type | n )

inline

## CodeString() [4/4]

gdcm::CodeString::CodeString | ( | const InternalClass & | s,
|  | size_type | pos = 0,
|  | size_type | n = InternalClass::npos )

inline

## Member Function Documentation

## GetAsString()

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

inline

Return the full code string as std::string.

## IsValid()

bool gdcm::CodeString::IsValid | ( |  | ) | const

Check if CodeString obj is correct..

## Size()

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

inline

Return the size of the string.

## TrimInternal()

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

inline protected

## Friends And Related Symbol Documentation

## operator!=

bool operator!= | ( | const CodeString & | ref,
|  | const CodeString & | cs )

friend

References CodeString().

## operator<<

std::ostream & operator<< | ( | std::ostream & | os,
|  | const CodeString & | str )

friend

References CodeString().

## operator==

bool operator== | ( | const CodeString & | ref,
|  | const CodeString & | cs )

friend

References CodeString().

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

- gdcmCodeString.h