OWLNext 7.0
Borland's Object Windows Library for the modern age
|
Encapsulates Windows code page functionality. More...
#include <owl/codepages.h>
Public Types | |
using | TCodePageId = uint |
Define the code page, code page object, and container types. | |
using | TCodePage = struct { TCodePageId CodePageId; bool Installed; tstring Name; } |
using | TCodePageList = std::vector<TCodePage> |
Static Public Member Functions | |
Code Page List Operations | |
static auto | GetCodePageList () -> const TCodePageList & |
Retrieves the code page list. | |
static auto | GetIndex (TCodePageId idCodePage) -> int |
Searches the code page list for a code page identifier. | |
Code Page WINAPI Wrapper Operations | |
static auto | GetOemCodePageId () -> TCodePageId |
Retrieves the current OEM code page identifier. | |
static auto | SetOemCodePageId (TCodePageId idCodePage) -> bool |
Sets the current OEM code page identifier. | |
static auto | GetAnsiCodePageId () -> TCodePageId |
Retrieves the current ANSI code page identifier. | |
static auto | SetAnsiCodePageId (TCodePageId idCodePage) -> bool |
Sets the current ANSI code page identifier. | |
static auto | GetCodePageInfoEx (TCodePageId idCodePage) -> CPINFOEX |
Retieves a CPINFOEX structure. | |
static auto | GetCodePageInfo (TCodePageId idCodePage) -> CPINFO |
Retieves a CPINFO structure. | |
static auto | GetMultiByteCodePage () -> TCodePageId |
Retieves the multi-byte code page identifier. | |
static auto | SetMultiByteCodePage (TCodePageId idCodePage) -> bool |
Sets the multi-byte code page identifier. | |
Encapsulates Windows code page functionality.
TCodePages is a static class and instantiation is not allowed. The code page list does not get loaded until accessed using GetCodePageList
or GetIndex
. Loading is performed only once and is persistent until the application terminates. The following sample code illustrates loading the code page list in a TComboBox control, retrieving the current code page identifier, initializing the selection of the control to the currently selected code page identifier, and changing the current code page to the user selection.
Definition at line 60 of file codepages.h.
using owl::TCodePages::TCodePage = struct { TCodePageId CodePageId; bool Installed; tstring Name; } |
Definition at line 68 of file codepages.h.
Define the code page, code page object, and container types.
Definition at line 67 of file codepages.h.
using owl::TCodePages::TCodePageList = std::vector<TCodePage> |
Definition at line 69 of file codepages.h.
|
inlinestatic |
Retrieves the current ANSI code page identifier.
Wrapper function for the Windows API GetACP
.
Definition at line 121 of file codepages.h.
|
inlinestatic |
Retieves a CPINFO structure.
Wrapper function for the Windows API GetCPInfo
.
[in] | idCodePage | is the code page identifier to use. |
Definition at line 171 of file codepages.h.
|
inlinestatic |
Retieves a CPINFOEX structure.
Wrapper function for the Windows API GetCPInfoEx
.
[in] | idCodePage | is the code page identifier to use. |
Definition at line 152 of file codepages.h.
|
static |
Retrieves the code page list.
Definition at line 98 of file codepages.cpp.
|
static |
Searches the code page list for a code page identifier.
[in] | idCodePage | is the code page identifier to find. |
Definition at line 86 of file codepages.cpp.
|
inlinestatic |
Retieves the multi-byte code page identifier.
Wrapper function for the Windows API _getmbcp
.
Definition at line 187 of file codepages.h.
|
inlinestatic |
Retrieves the current OEM code page identifier.
Wrapper function for the Windows API GetOEMCP
.
Definition at line 93 of file codepages.h.
|
inlinestatic |
Sets the current ANSI code page identifier.
Wrapper function for the Windows API SetACP
.
[in] | idCodePage | is the code page identifier to set. |
Definition at line 137 of file codepages.h.
References OWL_SET_ANSICP_.
|
inlinestatic |
Sets the multi-byte code page identifier.
Wrapper function for the Windows API _setmbcp
.
[in] | idCodePage | is the code page identifier to set. |
Definition at line 201 of file codepages.h.
|
inlinestatic |
Sets the current OEM code page identifier.
Wrapper function for the Windows API SetOEMCP
.
[in] | idCodePage | is the code page identifier to set. |
Definition at line 109 of file codepages.h.
References OWL_SET_OEMCP_.