OpenMS
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
StringManager Class Reference

#include <OpenMS/FORMAT/HANDLERS/XMLHandler.h>

Public Member Functions

 StringManager ()
 Constructor. More...
 
 ~StringManager ()
 Destructor. More...
 

Static Public Member Functions

static XMLSize_t strLength (const XMLCh *input_ptr)
 Calculates the length of a XMLCh* string using SIMDe. More...
 
static XercesString convert (const char *str)
 Transcode the supplied C string to a xerces string. More...
 
static XercesString convert (const std::string &str)
 Transcode the supplied C++ string to a xerces string. More...
 
static XercesString convert (const String &str)
 Transcode the supplied OpenMS string to a xerces string. More...
 
static unique_xerces_ptr< XMLChconvertPtr (const char *str)
 Transcode the supplied C string to a xerces string pointer. More...
 
static unique_xerces_ptr< XMLChconvertPtr (const std::string &str)
 Transcode the supplied C++ string to a xerces string pointer. More...
 
static unique_xerces_ptr< XMLChconvertPtr (const String &str)
 Transcode the supplied OpenMS string to a xerces string pointer. More...
 
static String convert (const XMLCh *str)
 Transcode the supplied XMLCh* to a String. More...
 
static bool isASCII (const XMLCh *chars, const XMLSize_t length)
 Checks if supplied chars in XMLCh* can be encoded with ASCII (i.e. the upper byte of each char is 0) More...
 
static void appendASCII (const XMLCh *str, const XMLSize_t length, String &result)
 Transcodes the supplied XMLCh* and appends it to the OpenMS String. More...
 

Static Protected Member Functions

static void compress64_ (const XMLCh *input_it, char *output_it)
 Compresses eight 8x16bit Chars in XMLCh* to 8x8bit Chars by cutting upper byte. More...
 

Private Types

typedef std::basic_string< XMLChXercesString
 

Static Private Member Functions

static unique_xerces_ptr< XMLChfromNative_ (const char *str)
 Converts from a narrow-character string to a wide-character string. More...
 
static unique_xerces_ptr< XMLChfromNative_ (const String &str)
 Converts from a narrow-character string to a wide-character string. More...
 
static String toNative_ (const XMLCh *str)
 Converts from a wide-character string to a narrow-character string. More...
 
static String toNative_ (const unique_xerces_ptr< XMLCh > &str)
 Converts from a wide-character string to a narrow-character string. More...
 

Member Typedef Documentation

◆ XercesString

typedef std::basic_string<XMLCh> XercesString
private

Constructor & Destructor Documentation

◆ StringManager()

Constructor.

◆ ~StringManager()

Destructor.

Member Function Documentation

◆ appendASCII()

static void appendASCII ( const XMLCh str,
const XMLSize_t  length,
String result 
)
static

Transcodes the supplied XMLCh* and appends it to the OpenMS String.

Note
Assumes that the XMLCh* only contains ASCII characters

◆ compress64_()

static void compress64_ ( const XMLCh input_it,
char *  output_it 
)
staticprotected

Compresses eight 8x16bit Chars in XMLCh* to 8x8bit Chars by cutting upper byte.

◆ convert() [1/4]

static XercesString convert ( const char *  str)
inlinestatic

◆ convert() [2/4]

static XercesString convert ( const std::string &  str)
inlinestatic

Transcode the supplied C++ string to a xerces string.

◆ convert() [3/4]

static XercesString convert ( const String str)
inlinestatic

Transcode the supplied OpenMS string to a xerces string.

◆ convert() [4/4]

static String convert ( const XMLCh str)
inlinestatic

Transcode the supplied XMLCh* to a String.

◆ convertPtr() [1/3]

◆ convertPtr() [2/3]

static unique_xerces_ptr<XMLCh> convertPtr ( const std::string &  str)
inlinestatic

Transcode the supplied C++ string to a xerces string pointer.

◆ convertPtr() [3/3]

static unique_xerces_ptr<XMLCh> convertPtr ( const String str)
inlinestatic

Transcode the supplied OpenMS string to a xerces string pointer.

◆ fromNative_() [1/2]

static unique_xerces_ptr<XMLCh> fromNative_ ( const char *  str)
inlinestaticprivate

Converts from a narrow-character string to a wide-character string.

◆ fromNative_() [2/2]

static unique_xerces_ptr<XMLCh> fromNative_ ( const String str)
inlinestaticprivate

Converts from a narrow-character string to a wide-character string.

◆ isASCII()

static bool isASCII ( const XMLCh chars,
const XMLSize_t  length 
)
static

Checks if supplied chars in XMLCh* can be encoded with ASCII (i.e. the upper byte of each char is 0)

◆ strLength()

static XMLSize_t strLength ( const XMLCh input_ptr)
static

Calculates the length of a XMLCh* string using SIMDe.

◆ toNative_() [1/2]

static String toNative_ ( const unique_xerces_ptr< XMLCh > &  str)
inlinestaticprivate

Converts from a wide-character string to a narrow-character string.

References unique_xerces_ptr< T >::get().

◆ toNative_() [2/2]

static String toNative_ ( const XMLCh str)
inlinestaticprivate

Converts from a wide-character string to a narrow-character string.

References unique_xerces_ptr< T >::get().