예제 #1
0
파일: CFFI.cpp 프로젝트: Shin-NiL/hxcpp
void buffer_append_sub(buffer inBuffer,const char *inStr,int inLen)
{
   ByteArray b = (ByteArray)inBuffer;
   int olen = b->length;
   b->__SetSize(olen+inLen);
   memcpy(b->GetBase()+olen,inStr,inLen);
}
예제 #2
0
파일: CFFI.cpp 프로젝트: Shin-NiL/hxcpp
value buffer_to_string(buffer inBuffer)
{
   ByteArray b = (ByteArray) inBuffer;
   String str(b->GetBase(),b->length);
        Dynamic d(str);
   return (value)d.GetPtr();
}
예제 #3
0
파일: CFFI.cpp 프로젝트: Shin-NiL/hxcpp
buffer alloc_buffer(const char *inStr)
{
   int len = inStr ? strlen(inStr) : 0;
   ByteArray b = new Array_obj<unsigned char>(len,len);
   if (len)
      memcpy(b->GetBase(),inStr,len);
   return (buffer)b;
}
예제 #4
0
파일: CFFI.cpp 프로젝트: Shin-NiL/hxcpp
void buffer_append(buffer inBuffer,const char *inStr)
{
   ByteArray b = (ByteArray)inBuffer;
   int olen = b->length;
   int len = strlen(inStr);
   b->__SetSize(olen+len);
   memcpy(b->GetBase()+olen,inStr,len);

}
예제 #5
0
파일: CFFI.cpp 프로젝트: Shin-NiL/hxcpp
char * buffer_data(buffer inBuffer)
{
   ByteArray b = (ByteArray)inBuffer;
   return b->GetBase();
}