scim_utility.h File Reference

various utility functions. More...


Namespaces

namespace  scim

Defines

#define SCIM_PATH_DELIM_STRING   "/"
#define SCIM_PATH_DELIM   '/'
#define RET_ILSEQ   0
#define RET_TOOFEW(n)   (-1-(n))
#define RET_TOOSMALL   -1
#define BAD_WCHAR   ((ucs4_t) 0xfffd)
#define BAD_CHAR   '?'

Functions

int scim::utf8_mbtowc (ucs4_t *pwc, const unsigned char *src, int src_len)
 Convert an utf8 char sequence to ucs4.
int scim::utf8_wctomb (unsigned char *dest, ucs4_t wc, int dest_size)
 Convert an ucs4 code to utf8 char sequence.
WideString scim::utf8_mbstowcs (const String &str)
 Convert an utf8 string to an ucs4 string.
WideString scim::utf8_mbstowcs (const char *str, int len=-1)
 Convert an utf8 string to an ucs4 string.
String scim::utf8_wcstombs (const WideString &wstr)
 Convert an ucs4 string to an utf8 string.
String scim::utf8_wcstombs (const ucs4_t *wstr, int len=-1)
 Convert an ucs4 string to an utf8 string.
ucs4_t scim::utf8_read_wchar (std::istream &is)
 Read a wide char from istream.
std::ostream & scim::utf8_write_wchar (std::ostream &os, ucs4_t wc)
 Write a wide char to ostream.
WideString scim::utf8_read_wstring (std::istream &is, ucs4_t delim=(ucs4_t) '\n', bool rm_delim=true)
 Read a wide string from istream.
std::ostream & scim::utf8_write_wstring (std::ostream &os, const WideString &wstr)
 Write a wide string to ostream.
void scim::scim_uint32tobytes (unsigned char *bytes, uint32 n)
 Convert an uint32 variable into a sequence of bytes.
uint32 scim::scim_bytestouint32 (const unsigned char *bytes)
 Convert a sequence of bytes into an uint32 value.
void scim::scim_uint16tobytes (unsigned char *bytes, uint16 n)
 Convert an uint16 variable into a sequence of bytes.
uint16 scim::scim_bytestouint16 (const unsigned char *bytes)
 Convert a sequence of bytes into an uint16 value.
String scim::scim_validate_locale (const String &locale)
 Test if the locale is valid, and return the good locale name.
String scim::scim_get_locale_encoding (const String &locale)
 Get the encoding for a locale.
String scim::scim_get_current_locale ()
 Get current system locale.
String scim::scim_get_current_language ()
 Get current system language.
int scim::scim_get_locale_maxlen (const String &locale)
 Get the max length of the multibyte char of a locale.
int scim::scim_split_string_list (std::vector< String > &vec, const String &str, char delim= ',')
 Split string list into a string vector according to the delim char.
String scim::scim_combine_string_list (const std::vector< String > &vec, char delim= ',')
 Combine a string vector into one string list, separated by char delim.
bool scim::scim_is_little_endian ()
 Get machine endian type.
bool scim::scim_if_wchar_ucs4_equal ()
 Test if wchar_t is using UCS4 encoding.
ucs4_t scim::scim_wchar_to_full_width (ucs4_t code)
 Convert a half width unicode char to its full width counterpart.
ucs4_t scim::scim_wchar_to_half_width (ucs4_t code)
 Convert a full width unicode char to its half width counterpart.
String scim::scim_get_home_dir ()
 Get the home dir of current user.
String scim::scim_get_user_name ()
 Get the name of current user.
String scim::scim_get_user_data_dir ()
 Get SCIM data dir of current user.
size_t scim::scim_load_file (const String &filename, char **bufptr)
 Load a file into memory.
bool scim::scim_make_dir (const String &dir)
 Make a directory.
String scim::scim_get_language_name (const String &lang)
 Get the localized name of a language id.
String scim::scim_get_language_name_english (const String &lang)
 Get the English name of a language id.
String scim::scim_get_language_name_untranslated (const String &lang)
 Get the untranslated name of a language id.
String scim::scim_get_language_locales (const String &lang)
 Get the supported locales for a language.
String scim::scim_get_locale_language (const String &locale)
 Get the language id for a locale.
String scim::scim_validate_language (const String &lang)
 Test if the language is valid, and return the good language code.
String scim::scim_get_normalized_language (const String &lang)
 Get the normalized language id of a language.
int scim::scim_launch (bool daemon, const String &config, const String &imengines, const String &frontend, char *const argv[]=0)
 Launch a SCIM process with specific options.
int scim::scim_launch_panel (bool daemon, const String &config, const String &display, char *const argv[]=0)
 Launch a SCIM Panel process with specific options.
void scim::scim_usleep (unsigned int usec)
 Sleep some microseconds.
void scim::scim_daemon ()
 Switch process into daemon mode.


Detailed Description

various utility functions.


Generated on Sat Jun 21 21:12:57 2008 for scim by  doxygen 1.4.7