Teamcenter C++ API Reference  2312
Classes | Namespaces
FndStringUtils.hxx File Reference
#include <unidefs.h>
#include <string>
#include <string.h>
#include <base_utils/libbase_utils_exports.h>
#include <base_utils/libbase_utils_undef.h>

Go to the source code of this file.

Classes

class  Teamcenter::FndStringUtils
 

Namespaces

namespace  Teamcenter
 A convenient C++ class to manage a list of tag_t. This convenient class is derived from TagList class which is only available for internal developers.
 

Detailed Description

Adding header intended for C++ style APIs. The APIs operate on std::string which cannot be added to C style header FndStringUtils.h. The purpose of adding APIs having std::string parameter is to make the caller implementation simpler. The caller does not require to free the memory of the output parameter.

With Visual Studio 2017, there is a build break with std::transform calls. When std::transform calls (with to_lower and to_uppper operations) are replaced by tc_strupr or tc_strlwr, each caller has to take care of freeing the memory of the output string. Moreover, the memroy cleanup has to be done by C function free() instead of using using scoped_ptr ( which uses "delete" ) and scoped_smptr ( which used SM_free ). This could lead to memory leaks or freeing the memory incorrecty. Hence, new APIs, provided in this header, abstracts out the memory cleanup implementation and caller does not have to worry about it.

Definition in file FndStringUtils.hxx.