#include <string_converter.h>
Public Member Functions | |
| StringConverter (zmm::String from, zmm::String to) | |
| virtual | ~StringConverter () |
| zmm::String | convert (zmm::String str, bool validate=false) |
| Converts uses the from and to values that were passed to the constructor to convert the string str to a specific character set. | |
| bool | validate (zmm::String str) |
| void | retain () |
| void | release () |
| int | getRefCount () |
Static Public Member Functions | |
| static zmm::Ref< StringConverter > | i2f () |
| internal (UTF-8) to filesystem | |
| static zmm::Ref< StringConverter > | f2i () |
| filesystem to internal | |
| static zmm::Ref< StringConverter > | m2i () |
| metadata to internal | |
| static void * | operator new (size_t size) |
| static void | operator delete (void *ptr) |
Protected Member Functions | |
| zmm::String | _convert (zmm::String str, bool validate, size_t *stoppedAt=NULL) |
Protected Attributes | |
| iconv_t | cd |
| bool | dirty |
| mt_atomic_t | _ref_count |
| pthread_mutex_t | mutex |
Definition at line 38 of file string_converter.h.
| StringConverter::StringConverter | ( | zmm::String | from, | |
| zmm::String | to | |||
| ) |
Definition at line 41 of file string_converter.cc.
References _, _Exception, zmm::String::c_str(), cd, and dirty.
| StringConverter::~StringConverter | ( | ) | [virtual] |
Definition at line 53 of file string_converter.cc.
References cd.
| zmm::String StringConverter::_convert | ( | zmm::String | str, | |
| bool | validate, | |||
| size_t * | stoppedAt = NULL | |||
| ) | [protected] |
Definition at line 98 of file string_converter.cc.
References _, _Exception, zmm::String::c_str(), cd, dirty, FREE, zmm::String::length(), log_debug, log_error, MALLOC, and NULL.
Referenced by convert(), and validate().
| zmm::String StringConverter::convert | ( | zmm::String | str, | |
| bool | validate = false | |||
| ) |
Converts uses the from and to values that were passed to the constructor to convert the string str to a specific character set.
| str | String to be converted. | |
| validate | if this parameter is true then an exception will be thrown if illegal input is encountered. If false, illegal characters will be padded with '?' and the function will return the string. |
Definition at line 59 of file string_converter.cc.
References _convert(), zmm::String::length(), string_ok(), and zmm::String::substring().
| Ref< StringConverter > StringConverter::f2i | ( | ) | [static] |
filesystem to internal
Definition at line 201 of file string_converter.cc.
References _, CFG_IMPORT_FILESYSTEM_CHARSET, DEFAULT_INTERNAL_CHARSET, Singleton< ConfigManager >::getInstance(), and StringConverter().
Referenced by SQLStorage::_ensurePathExistence(), FallbackLayout::addImage(), ContentManager::addRecursive(), FallbackLayout::addVideo(), ContentManager::createObjectFromFile(), web::files::process(), and web::directories::process().
| int Object::getRefCount | ( | ) | [inherited] |
Definition at line 78 of file object.cc.
References zmm::Object::_ref_count, and atomic_get().
| Ref< StringConverter > StringConverter::i2f | ( | ) | [static] |
internal (UTF-8) to filesystem
Definition at line 194 of file string_converter.cc.
References _, CFG_IMPORT_FILESYSTEM_CHARSET, DEFAULT_INTERNAL_CHARSET, Singleton< ConfigManager >::getInstance(), and StringConverter().
| Ref< StringConverter > StringConverter::m2i | ( | ) | [static] |
metadata to internal
Definition at line 207 of file string_converter.cc.
References _, CFG_IMPORT_METADATA_CHARSET, DEFAULT_INTERNAL_CHARSET, Singleton< ConfigManager >::getInstance(), and StringConverter().
| void Object::operator delete | ( | void * | ptr | ) | [static, inherited] |
| void * Object::operator new | ( | size_t | size | ) | [static, inherited] |
| void Object::release | ( | ) | [inherited] |
Definition at line 66 of file object.cc.
References zmm::Object::_ref_count, atomic_dec(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::clear(), zmm::String::operator=(), DSOHash< zmm::Array< CacheObject > >::releaseData(), DSBHash< VT >::releaseData(), DSOHash< zmm::Array< CacheObject > >::remove(), zmm::ArrayBase::remove(), zmm::ArrayBase::removeUnordered(), zmm::ArrayBase::set(), zmm::ArrayBase::~ArrayBase(), DSOHash< zmm::Array< CacheObject > >::~DSOHash(), zmm::ObjectQueue< AutoscanDirectory >::~ObjectQueue(), zmm::ObjectStack< Element >::~ObjectStack(), and zmm::String::~String().
| void Object::retain | ( | ) | [inherited] |
Definition at line 58 of file object.cc.
References zmm::Object::_ref_count, atomic_inc(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::append(), zmm::ObjectQueue< AutoscanDirectory >::enqueue(), zmm::ArrayBase::insert(), zmm::String::operator=(), zmm::ObjectStack< Element >::push(), DSOHash< zmm::Array< CacheObject > >::put(), DSBHash< VT >::put(), zmm::ArrayBase::set(), and zmm::String::String().
| bool StringConverter::validate | ( | zmm::String | str | ) |
Definition at line 85 of file string_converter.cc.
References _convert().
mt_atomic_t zmm::Object::_ref_count [protected, inherited] |
Definition at line 54 of file object.h.
Referenced by zmm::Object::getRefCount(), zmm::Object::Object(), zmm::Object::release(), and zmm::Object::retain().
iconv_t StringConverter::cd [protected] |
Definition at line 77 of file string_converter.h.
Referenced by _convert(), StringConverter(), and ~StringConverter().
bool StringConverter::dirty [protected] |
Definition at line 78 of file string_converter.h.
Referenced by _convert(), and StringConverter().
pthread_mutex_t zmm::Object::mutex [protected, inherited] |
Reimplemented in AutoscanList, AutoscanInotify, CachedURL, Dictionary_r, DVDNavReader, IOHandlerBufferHelper, ReentrantArray< T >, SingletonManager, Singleton< T >, StorageCache, MutexAutolock, Cond, ThreadExecutor, Singleton< UpdateManager >, Singleton< Timer >, Singleton< ContentDirectoryService >, Singleton< ConfigManager >, Singleton< Server >, Singleton< Runtime >, Singleton< ContentManager >, Singleton< ConnectionManagerService >, Singleton< PlayHook >, Singleton< Storage >, and Singleton< SessionManager >.
Definition at line 56 of file object.h.
Referenced by zmm::Object::Object(), zmm::Object::release(), zmm::Object::retain(), and zmm::Object::~Object().
1.6.1