7 #ifndef _QITYPE_DETAILS_TYPESTRING_HXX_
8 #define _QITYPE_DETAILS_TYPESTRING_HXX_
17 std::string res(raw.first.first, raw.first.second);
19 raw.second(raw.first);
25 set(storage, val.c_str(), val.size());
36 std::string* ptr = (std::string*)Methods::ptrFromStorage(&storage);
40 virtual void set(
void** storage,
const char* value,
size_t sz)
42 std::string* ptr = (std::string*)Methods::ptrFromStorage(storage);
43 ptr->assign(value, sz);
61 virtual void set(
void** storage,
const char* ptr,
size_t sz)
87 char* res =
new char[I];
100 virtual void set(
void** storage,
const char* ptr,
size_t sz)
124 virtual void set(
void** storage,
const char* ptr,
size_t sz)
127 *inst = T(std::string(ptr, sz));
141 template<
typename T,
typename F>
151 #define QI_EQUIVALENT_STRING_REGISTER(type, func) \
152 static bool BOOST_PP_CAT(__qi_registration, __COUNTER__) \
153 = qi::registerType(typeid(type), qi::makeTypeEquivalentString((type*)0, func))
155 #endif // _QITYPE_DETAILS_TYPESTRING_HXX_
virtual void * ptrFromStorage(void **)=0
virtual void * clone(void *src)
Allocate a storage and copy the value given as an argument.
DefaultTypeImplMethods< std::string, TypeByPointerPOD< std::string > > Methods
#define _QI_BOUNCE_TYPE_METHODS_NOCLONE(Bounce)
Implement all methods of Type except clone/destroy as bouncers to Bouncer.
std::pair< RawString, Deleter > ManagedRawString
StringTypeInterface * makeTypeEquivalentString(T *, F f)
#define qiLogCategory(Cat)
DefaultTypeImplMethods< char[I], TypeByPointerPOD< char[I]> > Methods
#define qiLogWarning(...)
Log in warning mode.
DefaultTypeImplMethods< T, TypeByPointerPOD< T > > Impl
boost::function< void(const RawString &)> Deleter
TypeEquivalentString(F f)
virtual void destroy(void *ptr)
Free all resources of a storage.
detail::Accessor< A >::value_type & fieldValue(C *instance, A accessor, void **data)
virtual void destroy(void *src)
Free all resources of a storage.
std::pair< char *, size_t > RawString
#define _QI_BOUNCE_TYPE_METHODS(Bounce)
Implement all methods of Type as bouncers to Bouncer.
virtual void set(void **storage, const char *ptr, size_t sz)
Set the value of the string.
_QI_BOUNCE_TYPE_METHODS(Impl)
virtual void * clone(void *src)
Allocate a storage and copy the value given as an argument.
void set(void **storage, const std::string &value)
Set the value of the string.
virtual void set(void **storage, const char *ptr, size_t sz)
Set the value of the string.
DefaultTypeImplMethods< char *, TypeByValue< char * > > Methods
void * fieldStorage(C *inst, A accessor)
std::string getString(void *storage)
Get a copy of the string value.
static void * ptrFromStorage(void **storage)
virtual void set(void **storage, const char *value, size_t sz)
Set the value of the string.
virtual void set(void **storage, const char *ptr, size_t sz)
Set the value of the string.
char * strdup(const char *src)
Implement POSIX compliant strdup.