#ifdef __cplusplus extern "C" { #endif #pragma once #include "stdcxxType.h" #include "STDDeletable.h" #define STRING_DECL_VIRT(Type) \ #define STRING_DECL_NONVIRT(Type) \ Type##_p Type##_newCppString ( const char* p );\ const char* Type##_cppString_c_str ( Type##_p p );\ string_p Type##_cppString_append ( Type##_p p, string_p str );\ string_p Type##_cppString_erase ( Type##_p p ); #define STRING_DECL_ACCESSOR(Type) \ #define STRING_DEF_VIRT(Type) \ #define STRING_DEF_NONVIRT(Type) \ Type##_p Type##_newCppString ( const char* p ) {\ Type* newp=new Type(p);return from_nonconst_to_nonconst(newp);\ }\ \ const char* Type##_cppString_c_str ( Type##_p p ) {\ return ((TYPECASTMETHOD(Type, cppString_c_str, string))(p))->c_str();\ }\ \ string_p Type##_cppString_append ( Type##_p p, string_p str ) {\ return from_nonconst_to_nonconst(&(((TYPECASTMETHOD(Type, cppString_append, string))(p))->append(from_nonconstref_to_nonconstref(*(str)))));\ }\ \ string_p Type##_cppString_erase ( Type##_p p ) {\ return from_nonconst_to_nonconst(&(((TYPECASTMETHOD(Type, cppString_erase, string))(p))->erase()));\ } #define STRING_DEF_ACCESSOR(Type) \ DELETABLE_DECL_VIRT(string) STRING_DECL_VIRT(string) STRING_DECL_NONVIRT(string) STRING_DECL_ACCESSOR(string) #ifdef __cplusplus } #endif