Solid File System

Virtual file system enigne that can be embedded into your software.

SolFSStorage.AnsiToWideChar method

Filter:

Pascal    Plain C    C++ (DLL/Lib)    C++ (VCL)    C++ (.NET)    C#    VB.NET    Java 

SolFSStorage     See also    

Overview

OPERATING SYSTEM EDITION
Converts text in system default encoding to UTF-16

APPLICATION EDITION
Not applicable

Declaration

[Pascal]
not implemented;

[Plain C]
    long _stdcall StorageAnsiToWideChar( PChar Src, PWideChar *Buffer, LongWord *BufferSize, Bool AllocateBuffer );

[C++ (DLL/Lib)]
not implemented;

[C++ (VCL)]
not implemented;

[C++ (.NET)]
not implemented;

[C#]
not implemented;

[VB.NET]
not implemented;

[Java]
not applicable;

Parameters

  • Src - source text in system default encoding to be converted
  • Buffer - the buffer that holds the result of conversion (see method description)
  • BufferSize - size of the buffer (see method description)
  • AllocateBuffer - specifies whether the new buffer must be allocated or the passed one should be used

Return value

     [Plain C]  0 if the function succeeded or one of Error codes if the function failed.

Description

This function is currently implemented only in SolFS Operating System edition for Linux, FreeBSD and MacOS X.

Use this method to convert the string in current encoding (the one used by the OS for the current process), to UTF-16 encoding used by SolFS. Current encoding is determined using GetACP() function on Windows and setlocale() on Linux, FreeBSD and MacOS X.

You can specify the existing buffer to store the result by setting AllocateBuffer parameter to false. In this case you need to pass the existing buffer in Buffer parameter and set BufferSize to the size of the buffer. On return BufferSize will contain size of the converted data including terminating null character. If the passed buffer was large enough to hold the data, the data is copied to this buffer.

Alternatively you can tell SolFS API to allocate new buffer. In this case Buffer parameter will be set to the newly allocated buffer and BufferSize will contain the size of the buffer (i.e. the size of the returned data including terminating null character). Allocated buffer must be freed using a call to FreeBuffer.

See also

FreeBuffer     WideCharToAnsi    

Back to top