NX Open C++ Reference Guide
Public Types | Public Member Functions | Friends | List of all members
NXOpen::NXString Class Reference

An internationalized NX text string. More...

Public Types

enum  NXStringMode {
  UTF8, Locale, Unknown, AssumedLocale,
  AssumedUTF8
}
 Specifies the language mode. More...
 

Public Member Functions

const char * GetLocaleText () const
 Returns the text in the encoding supported by the current locale. More...
 
const char * getLocaleText () const
 Identical to GetLocaleText() but with old name. More...
 
NXStringMode GetMode () const
 Returns the mode that was used to create this string. More...
 
NXStringMode getMode () const
 Identical to GetMode() but with old name. More...
 
const char * GetText () const
 Returns the text that was passed into the constructor. More...
 
const char * getText () const
 Identical to GetText() but with old name. More...
 
const char * GetUTF8Text () const
 Returns the text in UTF_8 encoding. More...
 
const char * getUTF8Text () const
 Identical to GetUTF8Text() but with old name. More...
 
 NXString (const char *text, NXStringMode mode=Unknown)
 Creates an NXString from an encoded character array. More...
 
 NXString (const std::string &text, NXStringMode mode=Unknown)
 <DEL>@ More...
 
 NXString (const NXString &other)
 <DEL>@ More...
 
NXStringoperator+= (const NXString &s)
 Append the argument to this string. More...
 
NXStringoperator= (const NXString &other)
 Assignment operator. More...
 
 ~NXString ()
 NXString destructor. More...
 

Friends

NXOPENCPPEXPORT NXString operator+ (const NXString &a, const char *b)
 Concatenate two strings. More...
 
NXOPENCPPEXPORT NXString operator+ (const char *a, const NXString &b)
 Concatenate two strings. More...
 

Detailed Description

An internationalized NX text string.

Member Enumeration Documentation

Specifies the language mode.

Enumerator
UTF8 

UTF8.

Locale 

Locale <DEL>

Unknown 

Only for Internal code.

AssumedLocale 

Only for Internal code.

AssumedUTF8 

Only for Internal code <DEL>

Constructor & Destructor Documentation

NXOpen::NXString::NXString ( const char *  text,
NXStringMode  mode = Unknown 
)

Creates an NXString from an encoded character array.

If mode == NXStringUTF8, the character array is assumed to be UTF8. If mode == NXStringLocale, the character array is assumed to be in the current locale's encoding. <DEL>@ <Keith hafen>=""> 27-Jul-2013 With NX running in UTF8 mode, the default char * constructor is wrong. For internal code the default should be Unknown, so the constructor figures it out from the data passed in.

NXOpen::NXString::NXString ( const std::string &  text,
NXStringMode  mode = Unknown 
)

<DEL>@

Creates an NXString from a std:string. If mode == NXStringUTF8, the string is assumed to be UTF8. If mode == NXStringLocale, the string is assumed to be in the current locale's encoding. <DEL>@ <Keith hafen>=""> 27-Jul-2013 With NX running in UTF8 mode, the default char * constructor is wrong. For internal code the default should be Unknown, so the constructor figures it out from the data passed in.

NXOpen::NXString::NXString ( const NXString other)

<DEL>@

Copy constructor

NXOpen::NXString::~NXString ( )

NXString destructor.

Member Function Documentation

const char* NXOpen::NXString::GetLocaleText ( ) const

Returns the text in the encoding supported by the current locale.

const char* NXOpen::NXString::getLocaleText ( ) const

Identical to GetLocaleText() but with old name.

Deprecated.

NXStringMode NXOpen::NXString::GetMode ( ) const

Returns the mode that was used to create this string.

NXString objects returned from the NX API will have the mode set according to the underlying implementation. This if a member-funtion GetName() returns an NXString in NXStringLocale mode, the underlying name is stored in a locale-specific encoding. If the string is returned in NXStringUTF8 mode, the underlying name is stored internally in UTF8 mode.

NXStringMode NXOpen::NXString::getMode ( ) const

Identical to GetMode() but with old name.

Deprecated.

const char* NXOpen::NXString::GetText ( ) const

Returns the text that was passed into the constructor.

const char* NXOpen::NXString::getText ( ) const

Identical to GetText() but with old name.

Deprecated.

const char* NXOpen::NXString::GetUTF8Text ( ) const

Returns the text in UTF_8 encoding.

const char* NXOpen::NXString::getUTF8Text ( ) const

Identical to GetUTF8Text() but with old name.

Deprecated.

NXString& NXOpen::NXString::operator+= ( const NXString s)

Append the argument to this string.

The argument is treated as text in the current locale. <DEL>@ <DEL>@ Append the argument to this string. This string stays in the same mode. If this string is in locale mode and the argument is a UTF8 string then the result may lose characters that can not be represented in the current locale.

NXString& NXOpen::NXString::operator= ( const NXString other)

Assignment operator.

Friends And Related Function Documentation

NXOPENCPPEXPORT NXString operator+ ( const NXString a,
const char *  b 
)
friend

Concatenate two strings.

The second argument is treated as text in the current locale. The return value is a string of the same mode as the first argument

NXOPENCPPEXPORT NXString operator+ ( const char *  a,
const NXString b 
)
friend

Concatenate two strings.

The first argument is treated as text in the current locale. The return value is a string of the same mode as the second argument


The documentation for this class was generated from the following file:
Copyright 2016 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.