CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Functions
OdBcf::Utils Namespace Reference

Functions

bool isUnset (const OdBcf::OdBcfFileAttributesGroup &value)
 
template<class TUnsetable >
const TUnsetable & getUnset ()
 
template<>
const double & getUnset< double > ()
 
template<>
const long & getUnset< long > ()
 
template<>
const int & getUnset< int > ()
 
template<>
const OdStringgetUnset< OdString > ()
 
template<>
const OdAnsiString & getUnset< OdAnsiString > ()
 
template<>
const OdGUIDgetUnset< OdGUID > ()
 
bool isUnset (const bool &value)
 
bool isUnset (const float &value)
 
bool isUnset (const double &value)
 
bool isUnset (const long value)
 
bool isUnset (const int value)
 
bool isUnset (const OdString &value)
 
bool isUnset (const OdAnsiString &value)
 
bool isUnset (const char *value)
 
bool isUnset (const OdGUID &value)
 
template<class TInner >
bool isUnset (const OdSmartPtr< TInner > &value)
 
template<class TInner >
bool isUnset (const OdArray< TInner > &value)
 
template<class TKey , class TValue >
bool isUnset (const std::map< TKey, TValue > &value)
 
template<class TUnsetable >
void initUnset (TUnsetable &value)
 
bool parseBool (const OdString &value)
 
const OdStringboolToString (bool value)
 
BCF_EXPORT OdString formatDir (const OdString &dir)
 
BCF_EXPORT int createDir (const OdString &dir)
 
OdBcfTimeStampPtr getCurrentTime ()
 
OdResult createTextChild (TiXmlElement *pParent, const char *name, const char *value)
 
OdResult createConstructedChild (TiXmlElement *pParent, const char *name, const OdBcfElement *pValue)
 

Detailed Description

Contains declarations related to utilities related to working with BCF files content.

Function Documentation

◆ boolToString()

const OdString & OdBcf::Utils::boolToString ( bool  value)

Converts a boolean value to a string.

Parameters
value[in] A boolean value to be converted.
Returns
The string "true" if the specified boolean equals true; otherwise, the method returns the string "false".

◆ createConstructedChild()

OdResult OdBcf::Utils::createConstructedChild ( TiXmlElement *  pParent,
const char *  name,
const OdBcfElement pValue 
)

Adds a newly constructed child to a specified XML structure.

Parameters
pParent[in] A raw pointer to the parent of the new element.
name[in] A string that contains the name of the new element.
pValue[in] A raw pointer to an <link OdBcf::OdBcfElement, object> that is responsible for creating of the new element value.
Returns
eOk if the element was successfully created; otherwise, the method returns an appropriate error code.

◆ createDir()

BCF_EXPORT int OdBcf::Utils::createDir ( const OdString dir)

Creates an empty directory.

Parameters
dir[in] A string that contains the path to the new directory.
Returns
0 if the directory was successfully created; otherwise, the method returns an appropriate error code.

◆ createTextChild()

OdResult OdBcf::Utils::createTextChild ( TiXmlElement *  pParent,
const char *  name,
const char *  value 
)

Adds a new text child to a specified XML structure.

Parameters
pParent[in] A raw pointer to the parent of the new element.
name[in] A string that contains the name of the new element.
value[in] A string that contains the value of the new element.
Returns
eOk if the element was successfully created; otherwise, the method returns an appropriate error code.

◆ formatDir()

BCF_EXPORT OdString OdBcf::Utils::formatDir ( const OdString dir)

Formats a specified path to a file according to the curren`t platform.

Parameters
dir[in] A string containing the path to the file.
Returns
A string containing the formatted path.
Remarks
The function ensures that there is a separator on the end of the path.

◆ getCurrentTime()

OdBcfTimeStampPtr OdBcf::Utils::getCurrentTime ( )

Retrieves the local time and the system time zone.

Returns
A smart pointer to the created <link OdBcf::OdBcfTimeStamp, OdBcfTimeStamp> object that contains information about local time and time zone.

◆ getUnset()

template<class TUnsetable >
const TUnsetable & OdBcf::Utils::getUnset ( )

A template function that returns an undefined value for those BCF datatypes that do not have an implemented getUnset() function.

Returns
An undefined (unset) value.

Definition at line 52 of file BcfUnset.h.

◆ getUnset< double >()

template<>
const double & OdBcf::Utils::getUnset< double > ( )
inline

A template function that returns an undefined value for the double datatype.

Returns
A double value that represents an unset value.

Definition at line 58 of file BcfUnset.h.

◆ getUnset< int >()

template<>
const int & OdBcf::Utils::getUnset< int > ( )
inline

A template function that returns an undefined value for the int datatype.

Returns
An int value that represents an unset value.

Definition at line 70 of file BcfUnset.h.

◆ getUnset< long >()

template<>
const long & OdBcf::Utils::getUnset< long > ( )
inline

A template function that returns an undefined value for the long datatype.

Returns
A long value that represents an unset value.

Definition at line 64 of file BcfUnset.h.

◆ getUnset< OdAnsiString >()

template<>
const OdAnsiString & OdBcf::Utils::getUnset< OdAnsiString > ( )
inline

A template function that returns an undefined value for the <exref target="https://docs.opendesign.com/tkernel/OdAnsiString.html">OdAnsiString</exref> datatype.

Returns
<exref target="https://docs.opendesign.com/tkernel/OdAnsiString.html">OdAnsiString</exref> value that represents an unset value.

Definition at line 86 of file BcfUnset.h.

◆ getUnset< OdGUID >()

template<>
const OdGUID & OdBcf::Utils::getUnset< OdGUID > ( )
inline

A template function that returns an undefined value for the <exref target="https://docs.opendesign.com/tkernel/OdGUID.html">OdGUID</exref> datatype.

Returns
<exref target="https://docs.opendesign.com/tkernel/OdGUID.html">OdGUID</exref> value that represents an unset value.

Definition at line 94 of file BcfUnset.h.

◆ getUnset< OdString >()

template<>
const OdString & OdBcf::Utils::getUnset< OdString > ( )
inline

A template function that returns an undefined value for the <exref target="https://docs.opendesign.com/tkernel/OdString.html">OdString</exref> datatype.

Returns
<exref target="https://docs.opendesign.com/tkernel/OdString.html">OdString</exref> value that represents an unset value.

Definition at line 78 of file BcfUnset.h.

◆ initUnset()

template<class TUnsetable >
void OdBcf::Utils::initUnset ( TUnsetable &  value)

A function that initializes a passed value as an unset (undefined) one.

Parameters
value[out] A placeholder for the value to be initialized.

Definition at line 182 of file BcfUnset.h.

◆ isUnset() [1/13]

bool OdBcf::Utils::isUnset ( const bool &  value)
inline

A function that defines whether a specified boolean value is not set (undefined).

Returns
true if the value is not set; otherwise, the function returns false.

Definition at line 100 of file BcfUnset.h.

◆ isUnset() [2/13]

bool OdBcf::Utils::isUnset ( const char *  value)
inline

A function that defines whether a string value, represented as a null-terminated array of chars, is not set (undefined).

Returns
true if the value is not set; otherwise, the function returns false.

Definition at line 146 of file BcfUnset.h.

◆ isUnset() [3/13]

bool OdBcf::Utils::isUnset ( const double &  value)
inline

A function that defines whether a specified double value is not set (undefined).

Returns
true if the value is not set; otherwise, the function returns false.

Definition at line 112 of file BcfUnset.h.

◆ isUnset() [4/13]

bool OdBcf::Utils::isUnset ( const float &  value)
inline

A function that defines whether a specified float value is not set (undefined).

Returns
true if the value is not set; otherwise, the function returns false.

Definition at line 106 of file BcfUnset.h.

◆ isUnset() [5/13]

bool OdBcf::Utils::isUnset ( const int  value)
inline

A function that defines whether a specified unsigned integer value is not set (undefined).

Returns
true if the value is not set; otherwise, the function returns false.

Definition at line 124 of file BcfUnset.h.

◆ isUnset() [6/13]

bool OdBcf::Utils::isUnset ( const long  value)
inline

A function that defines whether a specified long value is not set (undefined).

Returns
true if the value is not set; otherwise, the function returns false.

Definition at line 118 of file BcfUnset.h.

◆ isUnset() [7/13]

bool OdBcf::Utils::isUnset ( const OdAnsiString &  value)
inline

A function that defines whether a specified <exref target="https://docs.opendesign.com/tkernel/OdAnsiString.html">OdAnsiString</exref> value is not set (undefined).

Returns
true if the value is not set; otherwise, the function returns false.

Definition at line 140 of file BcfUnset.h.

◆ isUnset() [8/13]

template<class TInner >
bool OdBcf::Utils::isUnset ( const OdArray< TInner > &  value)
inline

A function that defines whether an array of smart pointers is not set (undefined).

Returns
true if the array of smart pointers is not set; otherwise, the function returns false.

Definition at line 168 of file BcfUnset.h.

◆ isUnset() [9/13]

bool OdBcf::Utils::isUnset ( const OdBcf::OdBcfFileAttributesGroup value)
inline

Definition at line 69 of file BcfFileAttributesGroup.h.

◆ isUnset() [10/13]

bool OdBcf::Utils::isUnset ( const OdGUID value)
inline

A function that defines whether a specified <exref target="https://docs.opendesign.com/tkernel/OdGUID.html">OdGUID</exref> value is not set (undefined).

Returns
true if the value is not set; otherwise, the function returns false.

Definition at line 154 of file BcfUnset.h.

◆ isUnset() [11/13]

template<class TInner >
bool OdBcf::Utils::isUnset ( const OdSmartPtr< TInner > &  value)
inline

A function that defines whether a smart pointer is not set (undefined).

Returns
true if the smart pointer is not set; otherwise, the function returns false.

Definition at line 161 of file BcfUnset.h.

◆ isUnset() [12/13]

bool OdBcf::Utils::isUnset ( const OdString value)
inline

A function that defines whether a specified <exref target="https://docs.opendesign.com/tkernel/OdString.html">OdString</exref> value is not set (undefined).

Returns
true if the value is not set; otherwise, the function returns false.

Definition at line 132 of file BcfUnset.h.

◆ isUnset() [13/13]

template<class TKey , class TValue >
bool OdBcf::Utils::isUnset ( const std::map< TKey, TValue > &  value)
inline

A function that defines whether an STL map object is not set (undefined).

Returns
true if the map is not set; otherwise, the function returns false.

Definition at line 175 of file BcfUnset.h.

◆ parseBool()

bool OdBcf::Utils::parseBool ( const OdString value)

Checks if the specified string is equal to the "true" or "1".

Parameters
value[in] A string probably containing a boolean value.
Returns
true if the string is equal to one of the values mentioned above; otherwise, the method returns false.