diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 new file mode 100644 index 0000000..e4d82cd --- /dev/null +++ b/build/Jamfile.v2 @@ -0,0 +1,287 @@ +# copyright John Maddock 2003, Artyom Beilis 2010 +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt. + + + +project /boost/locale + : source-location ../src + ; + +import configure ; +import os ; +import toolset ; +import project ; +import feature ; + +# Features + +feature.feature boost.locale.iconv : on off : optional propagated ; +feature.feature boost.locale.icu : on off : optional propagated ; +feature.feature boost.locale.posix : on off : optional propagated ; +feature.feature boost.locale.std : on off : optional propagated ; +feature.feature boost.locale.winapi : on off : optional propagated ; + +# Configuration of libraries + +## iconv + +obj has_iconv_libc_obj : ../build/has_iconv.cpp ; +exe has_iconv : has_iconv_libc_obj ; +explicit has_iconv ; + +ICONV_PATH = [ modules.peek : ICONV_PATH ] ; +lib iconv + : + : $(ICONV_PATH)/lib shared shared + : + : $(ICONV_PATH)/include + ; +explicit iconv ; + +obj has_iconv_libc_ext : ../build/has_iconv.cpp iconv ; +exe has_external_iconv : has_iconv_libc_ext iconv ; +explicit has_external_iconv ; + + +ICU_PATH = [ modules.peek : ICU_PATH ] ; +ICU_LINK = [ modules.peek : ICU_LINK ] ; +if $(ICU_LINK) +{ + ICU_OPTS = $(ICU_PATH)/include $(ICU_LINK) $(ICU_PATH)/bin shared ; +} +else +{ + searched-lib icuuc : : $(ICU_PATH)/lib shared shared ; + searched-lib icuuc : : msvc debug icuucd $(ICU_PATH)/lib shared shared ; + searched-lib icuuc : : this_is_an_invalid_library_name ; + searched-lib icudt : : $(ICU_PATH)/lib icudata shared shared ; + searched-lib icudt : : $(ICU_PATH)/lib icudt msvc shared shared ; + searched-lib icudt : : this_is_an_invalid_library_name ; + searched-lib icuin : : $(ICU_PATH)/lib icui18n shared shared ; + searched-lib icuin : : msvc debug icuind $(ICU_PATH)/lib shared shared ; + searched-lib icuin : : msvc release icuin $(ICU_PATH)/lib shared shared ; + searched-lib icuin : : this_is_an_invalid_library_name ; + explicit icuuc icudt icuin ; + + ICU_OPTS = $(ICU_PATH)/include + icuuc/shared/shared + icudt/shared/shared + icuin/shared/shared + $(ICU_PATH)/bin + shared ; +} +exe has_icu : ../build/has_icu_test.cpp : $(ICU_OPTS) ; +explicit has_icu ; + + +# This function is called whenever the 'boost_locale' metatarget +# below is generated and figures what external components we have, +# what user wants, and what sources have to be compiled in the end. +rule configure-full ( properties * : flags-only ) +{ + + local result ; + local flags-result ; + + local found-iconv ; + + if on in $(properties) + || ! in $(properties:G) + && ! solaris in $(properties) + { + # See if iconv is bundled with standard library. + if [ configure.builds has_iconv : $(properties) : "iconv (libc)" ] + { + found-iconv = true ; + } + else + { + if [ configure.builds has_external_iconv : $(properties) : "iconv (separate)" ] + { + found-iconv = true ; + result += iconv ; + } + } + } + if $(found-iconv) + { + flags-result += BOOST_LOCALE_WITH_ICONV=1 ; + } + + local found-icu ; + if ! off in $(properties) + { + if [ configure.builds has_icu : $(properties) : "icu" ] + { + found-icu = true ; + flags-result += BOOST_LOCALE_WITH_ICU=1 $(ICU_OPTS) ; + + for s in boundary codecvt collator conversion date_time formatter + icu_backend numeric time_zone + { + result += icu/$(s).cpp ; + } + result += ../../thread/build//boost_thread ; + } + } + + if ! $(found-iconv) && ! $(found-icu) && ! windows in $(properties) && ! cygwin in $(properties) + { + ECHO "error: Boost.Locale needs either iconv or ICU library to be built." ; + EXIT ; + } + + if ! in $(properties:G) + { + if sun in $(properties) + { + properties += off ; + } + else + { + properties += on ; + } + } + + if off in $(properties) + { + flags-result += BOOST_LOCALE_NO_STD_BACKEND=1 ; + } + else + { + STD_SOURCES = + codecvt + collate + converter + numeric + std_backend + ; + result += std/$(STD_SOURCES).cpp ; + } + + if ! in $(properties:G) + { + if windows in $(properties) + || cygwin in $(properties) + { + properties += on ; + } + else + { + properties += off ; + } + } + + if off in $(properties) + { + flags-result += BOOST_LOCALE_NO_WINAPI_BACKEND=1 ; + } + else + { + WINAPI_SOURCES = + collate + converter + numeric + win_backend + ; + result += win32/$(WINAPI_SOURCES).cpp ; + } + + if ( ! off in $(properties) || ! off in $(properties) ) + && ( windows in $(properties) || cygwin in $(properties) ) + { + result += win32/lcid.cpp ; + } + + if ! in $(properties:G) + { + if linux in $(properties) || darwin in $(properties) + { + properties += on ; + } + else + { + properties += off ; + } + } + + if off in $(properties) + { + flags-result += BOOST_LOCALE_NO_POSIX_BACKEND=1 ; + } + else + { + POSIX_SOURCES = + collate + converter + numeric + codecvt + posix_backend + ; + result += posix/$(POSIX_SOURCES).cpp ; + } + + if on in $(properties) || on in $(properties) || on in $(properties) + { + result += util/gregorian.cpp ; + } + if "$(flags-only)" = "flags" + { + return $(flags-result) ; + } + else { + result += $(flags-result) ; + return $(result) ; + } +} + +rule configure ( properties * ) +{ + local result = [ configure-full $(properties) : "all" ] ; + return $(result) ; + +} + +rule configure-flags ( properties * ) +{ + local result ; + result = [ configure-full $(properties) : "flags" ] ; + return $(result) ; + +} + + +alias build_options : : : : @configure ; +alias build_flags : : : : @configure-flags ; + +lib boost_locale + : + encoding/codepage.cpp + shared/date_time.cpp + shared/format.cpp + shared/formatting.cpp + shared/generator.cpp + shared/ids.cpp + shared/localization_backend.cpp + shared/message.cpp + shared/mo_lambda.cpp + util/codecvt_converter.cpp + util/default_locale.cpp + util/info.cpp + util/locale_data.cpp + : + # Don't link explicitly, not required + BOOST_THREAD_NO_LIB=1 + shared:BOOST_LOCALE_DYN_LINK=1 + multi + # Meanwhile remove this + @configure + ; + +boost-install boost_locale ; + + +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 + diff --git a/build/has_iconv.cpp b/build/has_iconv.cpp new file mode 100644 index 0000000..422265c --- /dev/null +++ b/build/has_iconv.cpp @@ -0,0 +1,7 @@ +#include + +int main() +{ + iconv_t d = iconv_open(0,0); + (void)(d); +} diff --git a/build/has_icu_test.cpp b/build/has_icu_test.cpp new file mode 100644 index 0000000..9419b30 --- /dev/null +++ b/build/has_icu_test.cpp @@ -0,0 +1,29 @@ +/* + * + * Copyright (c) 2010 + * John Maddock + * + * Use, modification and distribution are subject to the + * Boost Software License, Version 1.0. (See accompanying file + * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * + */ + +#include +#include +#include +#include +#include + +#if defined(_MSC_VER) && !defined(_DLL) +#error "Mixing ICU with a static runtime doesn't work" +#endif + +int main() +{ + icu::Locale loc; + UErrorCode err = U_ZERO_ERROR; + UChar32 c = ::u_charFromName(U_UNICODE_CHAR_NAME, "GREEK SMALL LETTER ALPHA", &err); + return err; +} + diff --git a/doc/Doxyfile b/doc/Doxyfile new file mode 100644 index 0000000..c57d221 --- /dev/null +++ b/doc/Doxyfile @@ -0,0 +1,1635 @@ +# Doxyfile 1.7.1 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = Boost.Locale + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = . + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = ../../.. + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = ../../.. + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen to replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penality. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will rougly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = ../../../boost/locale/ \ + ../../../boost/locale/boundary \ + . + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = *.hpp *.txt + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = ../examples + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = header.html + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = footer.html + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the stylesheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = NO + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = YES + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = NO + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvances is that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = YES + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = YES + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = BOOST_HAS_CHAR32_T \ + BOOST_HAS_CHAR16_T \ + BOOST_LOCALE_DECL= \ + BOOST_LOCALE_DOXYGEN + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will write a font called FreeSans.ttf to the output +# directory and reference it in all dot files that doxygen generates. This +# font does not include all possible unicode characters however, so when you need +# these (or just want a differently looking font) you can specify the font name +# using DOT_FONTNAME. You need need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = FreeSans + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = YES + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/doc/appendix.txt b/doc/appendix.txt new file mode 100644 index 0000000..9fc388a --- /dev/null +++ b/doc/appendix.txt @@ -0,0 +1,18 @@ +// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 filetype=cpp.doxygen +/*! +\page appendix Appendix + +\section appendix_toc Table of Contents + +- \subpage rationale +- \subpage faq +- \subpage default_encoding_under_windows +- \subpage running_examples_under_windows +- \subpage gettext_for_windows +- \subpage glossary +- \subpage tested_compilers_and_paltforms +- \subpage status_of_cpp0x_characters_support +- \subpage special_thanks + +*/ + diff --git a/doc/boundary_analysys.txt b/doc/boundary_analysys.txt new file mode 100644 index 0000000..c8621bd --- /dev/null +++ b/doc/boundary_analysys.txt @@ -0,0 +1,495 @@ +// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 filetype=cpp.doxygen +/*! +\page boundary_analysys Boundary analysis + +- \ref boundary_analysys_basics +- \ref boundary_analysys_segments + - \ref boundary_analysys_segments_basics + - \ref boundary_analysys_segments_rules + - \ref boundary_analysys_segments_search +- \ref boundary_analysys_break + - \ref boundary_analysys_break_basics + - \ref boundary_analysys_break_rules + - \ref boundary_analysys_break_search + + +\section boundary_analysys_basics Basics + +Boost.Locale provides a boundary analysis tool, allowing you to split text into characters, +words, or sentences, and find appropriate places for line breaks. + +\note This task is not a trivial task. +\par +A Unicode code point and a character are not equivalent, for example: +Hebrew word Shalom - "שָלוֹם" that consists of 4 characters and 6 code points (4 base letters and 2 diacritical marks) +\par +Words may not be separated by space characters in some languages like in Japanese or Chinese. + +Boost.Locale provides 2 major classes for boundary analysis: + +- \ref boost::locale::boundary::segment_index - an object that holds an index of segments in the text (like words, characters, + sentences). It provides an access to \ref boost::locale::boundary::segment "segment" objects via iterators. +- \ref boost::locale::boundary::boundary_point_index - an object that holds an index of boundary points in the text. + It allows to iterate over the \ref boost::locale::boundary::boundary_point "boundary_point" objects. + +Each of the classes above use an iterator type as template parameter. +Both of these classes accept in their constructor: + +- A flag that defines boundary analysis \ref boost::locale::boundary::boundary_type "boundary_type". +- The pair of iterators that define the text range that should be analysed +- A locale parameter (if not given the global one is used) + +For example: +\code +namespace ba=boost::locale::boundary; +std::string text= ... ; +std::locale loc = ... ; +ba::segment_index map(ba::word,text.begin(),text.end(),loc); +\endcode + +Each of them provide a members \c begin(), \c end() and \c find() that allow to iterate +over the selected segments or boundaries in the text or find a location of a segment or +boundary for given iterator. + + +Convenience a typedefs like \ref boost::locale::boundary::ssegment_index "ssegment_index" +or \ref boost::locale::boundary::wcboundary_point_index "wcboundary_point_index" provided as well, +where "w", "u16" and "u32" prefixes define a character type \c wchar_t, +\c char16_t and \c char32_t and "c" and "s" prefixes define whether std::basic_string::const_iterator +or CharType const * are used. + +\section boundary_analysys_segments Iterating Over Segments +\section boundary_analysys_segments_basics Basic Iteration + +The text segments analysis is done using \ref boost::locale::boundary::segment_index "segment_index" class. + +It provides a bidirectional iterator that returns \ref boost::locale::boundary::segment "segment" object. +The segment object represents a pair of iterators that define this segment and a rule according to which it was selected. +It can be automatically converted to \c std::basic_string object. + +To perform boundary analysis, we first create an index object and then iterate over it: + +For example: + +\code +using namespace boost::locale::boundary; +boost::locale::generator gen; +std::string text="To be or not to be, that is the question." +// Create mapping of text for token iterator using global locale. +ssegment_index map(word,text.begin(),text.end(),gen("en_US.UTF-8")); +// Print all "words" -- chunks of word boundary +for(ssegment_index::iterator it=map.begin(),e=map.end();it!=e;++it) + std::cout <<"\""<< * it << "\", "; +std::cout << std::endl; +\endcode + +Would print: + +\verbatim +"To", " ", "be", " ", "or", " ", "not", " ", "to", " ", "be", ",", " ", "that", " ", "is", " ", "the", " ", "question", ".", +\endverbatim + +This sentence "生きるか死ぬか、それが問題だ。" (from Tatoeba database) +would be split into following segments in \c ja_JP.UTF-8 (Japanese) locale: + +\verbatim +"生", "きるか", "死", "ぬか", "、", "それが", "問題", "だ", "。", +\endverbatim + +The boundary analysis that is done by Boost.Locale +is much more complicated then just splitting the text according +to white space characters. + +Of course it may be not per + +\section boundary_analysys_segments_rules Using Rules + +The segments selection can be customized using \ref boost::locale::boundary::segment_index::rule(rule_type) "rule()" and +\ref boost::locale::boundary::segment_index::full_select(bool) "full_select()" member functions. + +By default segment_index's iterator return each text segment defined by two boundary points regardless +the way they were selected. Thus in the example above we could see text segments like "." or " " +that were selected as words. + +Using a \c rule() member function we can specify a binary mask of rules we want to use for selection of +the boundary points using \ref bl_boundary_word_rules "word", \ref bl_boundary_line_rules "line" +and \ref bl_boundary_sentence_rules "sentence" boundary rules. + +For example, by calling + +\code +map.rule(word_any); +\endcode + +Before starting the iteration process, specify a selection mask that fetches: numbers, letter, Kana letters and +ideographic characters ignoring all non-word related characters like white space or punctuation marks. + +So the code: + +\code +using namespace boost::locale::boundary; +std::string text="To be or not to be, that is the question." +// Create mapping of text for token iterator using global locale. +ssegment_index map(word,text.begin(),text.end()); +// Define a rule +map.rule(word_any); +// Print all "words" -- chunks of word boundary +for(ssegment_index::iterator it=map.begin(),e=map.end();it!=e;++it) + std::cout <<"\""<< * it << "\", "; +std::cout << std::endl; +\endcode + +Would print: + +\verbatim +"To", "be", "or", "not", "to", "be", "that", "is", "the", "question", +\endverbatim + +And the for given text="生きるか死ぬか、それが問題だ。" and rule(\ref boost::locale::boundary::word_ideo "word_ideo"), the example above would print. + +\verbatim +"生", "死", "問題", +\endverbatim + +You can access specific rules the segments where selected it using \ref boost::locale::boundary::segment::rule() "segment::rule()" member +function. Using a bit-mask of rules. + +For example: + +\code +boost::locale::generator gen; +using namespace boost::locale::boundary; +std::string text="生きるか死ぬか、それが問題だ。"; +ssegment_index map(word,text.begin(),text.end(),gen("ja_JP.UTF-8")); +for(ssegment_index::iterator it=map.begin(),e=map.end();it!=e;++it) { + std::cout << "Segment " << *it << " contains: "; + if(it->rule() & word_none) + std::cout << "white space or punctuation marks "; + if(it->rule() & word_kana) + std::cout << "kana characters "; + if(it->rule() & word_ideo) + std::cout << "ideographic characters"; + std::cout<< std::endl; +} +\endcode + +Would print + +\verbatim +Segment 生 contains: ideographic characters +Segment きるか contains: kana characters +Segment 死 contains: ideographic characters +Segment ぬか contains: kana characters +Segment 、 contains: white space or punctuation marks +Segment それが contains: kana characters +Segment 問題 contains: ideographic characters +Segment だ contains: kana characters +Segment 。 contains: white space or punctuation marks +\endverbatim + +One important things that should be noted that each segment is defined +by a pair of boundaries and the rule of its ending point defines +if it is selected or not. + +In some cases it may be not what we actually look like. + +For example we have a text: + +\verbatim +Hello! How +are you? +\endverbatim + +And we want to fetch all sentences from the text. + +The \ref bl_boundary_sentence_rules "sentence rules" have two options: + +- Split the text on the point where sentence terminator like ".!?" detected: \ref boost::locale::boundary::sentence_term "sentence_term" +- Split the text on the point where sentence separator like "line feed" detected: \ref boost::locale::boundary::sentence_sep "sentence_sep" + +Naturally to ignore sentence separators we would call \ref boost::locale::boundary::segment_index::rule(rule_type v) "segment_index::rule(rule_type v)" +with sentence_term parameter and then run the iterator. + +\code +boost::locale::generator gen; +using namespace boost::locale::boundary; +std::string text= "Hello! How\n" + "are you?\n"; +ssegment_index map(sentence,text.begin(),text.end(),gen("en_US.UTF-8")); +map.rule(sentence_term); +for(ssegment_index::iterator it=map.begin(),e=map.end();it!=e;++it) + std::cout << "Sentence [" << *it << "]" << std::endl; +\endcode + +However we would get the expected segments: +\verbatim +Sentence [Hello! ] +Sentence [are you? +] +\endverbatim + +The reason is that "How\n" is still considered a sentence but selected by different +rule. + +This behavior can be changed by setting \ref boost::locale::boundary::segment_index::full_select(bool) "segment_index::full_select(bool)" +to \c true. It would force iterator to join the current segment with all previous segments that may not fit the required rule. + +So we add this line: + +\code +map.full_select(true); +\endcode + +Right after "map.rule(sentence_term);" and get expected output: + +\verbatim +Sentence [Hello! ] +Sentence [How +are you? +] +\endverbatim + +\subsection boundary_analysys_segments_search Locating Segments + +Sometimes it is useful to find a segment that some specific iterator is pointing on. + +For example a user had clicked at specific point, we want to select a word on this +location. + +\ref boost::locale::boundary::segment_index "segment_index" provides +\ref boost::locale::boundary::segment_index::find() "find(base_iterator p)" +member function for this purpose. + +This function returns the iterator to the segmet such that \a p points to. + + +For example: + +\code +text="to be or "; +ssegment_index map(word,text.begin(),text.end(),gen("en_US.UTF-8")); +ssegment_index::iterator p = map.find(text.begin() + 4); +if(p!=map.end()) + std::cout << *p << std::endl; +\endcode + +Would print: + +\verbatim +be +\endverbatim + +\note + +if the iterator lays inside the segment this segment returned. If the segment does +not fit the selection rules, then the segment following requested position +is returned. + +For example: For \ref boost::locale::boundary::word "word" boundary analysis with \ref boost::locale::boundary::word_any "word_any" rule: + +- "t|o be or ", would point to "to" - the iterator in the middle of segment "to". +- "to |be or ", would point to "be" - the iterator at the beginning of the segment "be" +- "to| be or ", would point to "be" - the iterator does is not point to segment with required rule so next valid segment is selected "be". +- "to be or| ", would point to end as not valid segment found. + + +\section boundary_analysys_break Iterating Over Boundary Points +\section boundary_analysys_break_basics Basic Iteration + +The \ref boost::locale::boundary::boundary_point_index "boundary_point_index" is similar to +\ref boost::locale::boundary::segment_index "segment_index" in its interface but as a different role. +Instead of returning text chunks (\ref boost::locale::boundary::segment "segment"s, it returns +\ref boost::locale::boundary::boundary_point "boundary_point" object that +represents a position in text - a base iterator used that is used for +iteration of the source text C++ characters. +The \ref boost::locale::boundary::boundary_point "boundary_point" object +also provides a \ref boost::locale::boundary::boundary_point::rule() "rule()" member +function that defines a rule this boundary was selected according to. + +\note The beginning and the ending of the text are considered boundary points, so even +an empty text consists of at least one boundary point. + +Lets see an example of selecting first two sentences from a text: + +\code +using namespace boost::locale::boundary; +boost::locale::generator gen; + +// our text sample +std::string const text="First sentence. Second sentence! Third one?"; +// Create an index +sboundary_point_index map(sentence,text.begin(),text.end(),gen("en_US.UTF-8")); + +// Count two boundary points +sboundary_point_index::iterator p = map.begin(),e=map.end(); +int count = 0; +while(p!=e && count < 2) { + ++count; + ++p; +} + +if(p!=e) { + std::cout << "First two sentences are: " + << std::string(text.begin(),p->iterator()) + << std::endl; +} +else { + std::cout <<"There are less then two sentences in this " + <<"text: " << text << std::endl; +}\endcode + +Would print: + +\verbatim +First two sentences are: First sentence. Second sentence! +\endverbatim + +\section boundary_analysys_break_rules Using Rules + +Similarly to the \ref boost::locale::boundary::segment_index "segment_index" the +\ref boost::locale::boundary::boundary_point_index "boundary_point_index" provides +a \ref boost::locale::boundary::boundary_point_index::rule(rule_type r) "rule(rule_type mask)" +member function to filter boundary points that interest us. + +It allows to set \ref bl_boundary_word_rules "word", \ref bl_boundary_line_rules "line" +and \ref bl_boundary_sentence_rules "sentence" rules for filtering boundary points. + +Lets change an example above a little: + +\code +// our text sample +std::string const text= "First sentence. Second\n" + "sentence! Third one?"; +\endcode + +If we run our program as is on the sample above we would get: +\verbatim +First two sentences are: First sentence. Second +\endverbatim + +Which is not something that we really expected. As the "Second\n" +is considered an independent sentence that was separated by +a line separator "Line Feed". + +However, we can set set a rule \ref boost::locale::boundary::sentence_term "sentence_term" +and the iterator would use only boundary points that are created +by a sentence terminators like ".!?". + +So by adding: +\code +map.rule(sentence_term); +\endcode + +Right after the generation of the index we would get the desired output: + +\verbatim +First two sentences are: First sentence. Second +sentence! +\endverbatim + +You can also use \ref boost::locale::boundary::boundary_point::rule() "boundary_point::rule()" member +function to learn about the reason this boundary point was created by comparing it with an appropriate +mask. + +For example: + +\code +using namespace boost::locale::boundary; +boost::locale::generator gen; +// our text sample +std::string const text= "First sentence. Second\n" + "sentence! Third one?"; +sboundary_point_index map(sentence,text.begin(),text.end(),gen("en_US.UTF-8")); + +for(sboundary_point_index::iterator p = map.begin(),e=map.end();p!=e;++p) { + if(p->rule() & sentence_term) + std::cout << "There is a sentence terminator: "; + else if(p->rule() & sentence_sep) + std::cout << "There is a sentence separator: "; + if(p->rule()!=0) // print if some rule exists + std::cout << "[" << std::string(text.begin(),p->iterator()) + << "|" << std::string(p->iterator(),text.end()) + << "]\n"; +} +\endcode + +Would give the following output: +\verbatim +There is a sentence terminator: [First sentence. |Second +sentence! Third one?] +There is a sentence separator: [First sentence. Second +|sentence! Third one?] +There is a sentence terminator: [First sentence. Second +sentence! |Third one?] +There is a sentence terminator: [First sentence. Second +sentence! Third one?|] +\endverbatim + +\subsection boundary_analysys_break_search Locating Boundary Points + +Sometimes it is useful to find a specific boundary point according to given +iterator. + +\ref boost::locale::boundary::boundary_point_index "boundary_point_index" provides +a \ref boost::locale::boundary::boundary_point_index::find() "iterator find(base_iterator p)" member +function. + +It would return an iterator to a boundary point on \a p's location or at the +location following it if \a p does not point to appropriate position. + +For example, for word boundary analysis: + +- If a base iterator points to "to |be", then the returned boundary point would be "to |be" (same position) +- If a base iterator points to "t|o be", then the returned boundary point would be "to| be" (next valid position) + +For example if we want to select 6 words around specific boundary point we can use following code: + +\code +using namespace boost::locale::boundary; +boost::locale::generator gen; +// our text sample +std::string const text= "To be or not to be, that is the question."; + +// Create a mapping +sboundary_point_index map(word,text.begin(),text.end(),gen("en_US.UTF-8")); +// Ignore wite space +map.rule(word_any); + +// define our arbitraty point +std::string::const_iterator pos = text.begin() + 12; // "no|t"; + +// Get the search range +sboundary_point_index::iterator + begin =map.begin(), + end = map.end(), + it = map.find(pos); // find a boundary + +// go 3 words backward +for(int count = 0;count <3 && it!=begin; count ++) + --it; + +// Save the start +std::string::const_iterator start = *it; + +// go 6 words forward +for(int count = 0;count < 6 && it!=end; count ++) + ++it; + +// make sure we at valid position +if(it==end) + --it; + +// print the text +std::cout << std::string(start,it->iterator()) << std::endl; +\endcode + +That would print: + +\verbatim + be or not to be, that +\endverbatim + + +*/ + + diff --git a/doc/building_boost_locale.txt b/doc/building_boost_locale.txt new file mode 100644 index 0000000..da315fd --- /dev/null +++ b/doc/building_boost_locale.txt @@ -0,0 +1,209 @@ +// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 filetype=cpp.doxygen +/*! +\page building_boost_locale Building The library + +Boost.Locale presently supports CMake build system and Boost Build. + +\note You need Boost 1.46 and above to use Boost.Build + +- \ref building_boost_locale_bb +- \ref building_boost_locale_cmake +- \ref binary_compatibility + + +\section building_boost_locale_bb Building With Boost.Build + +You need Boost 1.46 and above to use Boost.Build, it includes important +patches that allow you to build the library correctly. + +\subsection bb_building_deps Dependencies + +- Boost 1.46 and above. +- ICU library 3.6 or above is strongly recommended +- If no ICU library is given, iconv support is required under POSIX platforms. + +\subsection bb_building_proc Building Process + +First of all we need to prepare our sources of Boost with Boost.Locale + +- Download latest version of Boost and extract its sources +- Download the latest version of Boost.Locale and extract its sources +- Copy boost and libs subdirectory of Boost.Locale sources into the location + of boost sources. +- Bootstrap latest bjam version running bootstrap.sh or bootstrap.bat. + +Now all you need to do is invoke bjam command: + +\verbatim +./bjam --with-locale stage +\endverbatim + +Or on Windows +\verbatim +.\bjam --with-locale stage +\endverbatim + +If you are using custom ICU build or you are using Microsoft Windows +you need to provide a path to location of ICU library using \c -sICU_PATH option + +For example: + +- If your icu build is placed at \c /opt/icu46 such that the files are placed like\n + \c /opt/icu46/include/unicode/uversion.h\n + \c /opt/icu46/include/unicode/calendar.h\n + \c ... \n + \c /opt/icu46/lib/libicudata.so \n + \c /opt/icu46/lib/libicui18n.so \n + \c ... \n + then you need to provide an option \c -sICU_PATH=/opt/icu46 + \verbatim + ./bjam --with-locale -sICU_PATH=/opt/icu46 stage + \endverbatim +- If your icu build is placed at c:\\icu46 such that the files are placed like \n + c:\\icu46\\include\\unicode\\uversion.h \n + c:\\icu46\\include\\unicode\\calendar.h \n + ... \n + c:\\icu46\\bin\\icudt.dll \n + c:\\icu46\\bin\\icuin.dll \n + ... \n + c:\\icu46\\lib\\icudt.lib \n + c:\\icu46\\lib\\icuin.lib \n + ... \n + then you need to provide an option \c -sICU_PATH=c:\\icu46 + \verbatim + .\bjam --with-locale -sICU_PATH=c:\icu46 stage + \endverbatim + +\note Don't forget to put both debug and release versions of ICU libraries in this path +when using Microsoft Visual Studio so Boost.Build will link correctly debug and release +versions of boost_locale library. + +\section bb_build_opts Build Options + +Boost.Locale supports following options with values \c off or \c on + +- \c boost.locale.icu=off disable build of ICU backend even if ICU library exists +- \c boost.locale.iconv=off or \c boost.locale.iconv=on enable or disable use of iconv + library. It is off by default on Windows and Solaris +- \c boost.locale.winapi=off - disable winapi backend, it is on by default on Windows and Cygwin +- \c boost.locale.std=off or \c boost.locale.winapi=on Disable or enable std backends. \c std backend + is disabled by default when using Sun Studio. +- \c boost.locale.posix=on or \c boost.locale.posix=off Enable or disable support of POSIX backend, + it is on by default on Linux and Mac OS X + +Also Boost.Locale supports following options + +- \c -sICU_PATH=/path/to/location/of/icu - the location of custom ICU library +- \c -sICONV_PATH=/path/to/location/of/iconv - the location of custom iconv library + + +For example: + +- Build the library on Windows with ICU backend only: + \verbatim + .\bjam boost.locale.winapi=off boost.locale.std=off -sICU_PATH=c:\icu46 --with-locale stage + \endverbatim +- Build the library on Linux with std backend only + \verbatim + .\bjam boost.locale.posix=off boost.locale.icu=off --with-locale stage + \endverbatim + +\section bb_build_test Running Unit Tests + +You can run unit tests by invoking \c bjam with \c libs/locale/test project parameter +\verbatim +./bjam libs/locale/test +\endverbatim + +\section building_boost_locale_cmake Building With CMake + +\note CMake build does not provide mangled library names like boost_locale-mt-gd.lib, so if you +rely on auto-linking use Boost.Build. + +\subsection cmake_building_deps Dependencies + +- CMake 2.6 and above. +- Boost 1.35 and above. +- Boost.Thread (when using ICU or when using Boost < 1.43) +- ICU library 3.6 or above is strongly recommended +- If no ICU library is given, iconv support is required under POSIX platforms. + +\subsection cmake_building_proc Building Process + +The library build should be fairly simple for users familiar with CMake. + +\note + +- MSVC Users: use \c nmake for building the library, MSVC projects are not supported! +- Windows users: don't forget to set the PATH environment variable to point to ICU's dlls. + +The simplest way to build the library is: + +- Extract its sources +- Go to the sources directory +- Create a subdirectory named "build" +- Go into this directory and run: + \code + cmake .. + make + make test + \endcode + For windows you may need to specify: + \code + cmake -DCMAKE_INCLUDE_PATH=/path/to/icu/include:/path/to/boost/include -DCMAKE_LIBRARY_PATH=/path/to/icu/lib .. + \endcode + And then: + \code + nmake + nmake test + \endcode + Or + \code + make && make test + \endcode + Depending on your compiler. + + +\section cmake_build_opts Build Options + +This options can be passed to CMake to configure the library to your needs. + +- \c DISABLE_SHARED - build only the static library +- \c DISABLE_STATIC - build only the shared library +- \c DISABLE_ICU - Disable the ICU backend (strongly discouraged) +- \c DISABLE_STD_BACKED - Disable the "std" backend +- \c DISABLE_POSIX_BACKEND - Disable the "posix" backend (ON by default on all but Linux and Mac OS X) +- \c DISABLE_WINAPI_BACKEND - Disable the "winapi" backend (ON by default on POSIX platforms). +- \c DISABLE_ICONV - Disable iconv-based conversion (ON by default on Windows) + +Useful CMake options: + +- \c CMAKE_INCLUDE_PATH - path to the boost library (if not system-wide) +- \c CMAKE_INSTALL_PREFIX - installation path +- \c CMAKE_BUILD_TYPE - default is Debug on Windows/MSVC and RelWithDebInfo on all other platforms. + +Examples: + +- Build Boost.Locale with only the "icu" backend on Linux + \code + cmake -DDISABLE_POSIX_BACKEND=ON -DDISABLE_STD_BACKEND=ON -DDISABLE_ICONV=ON .. + \endcode +- Build Boost.Locale with the "winapi" and "std" backends on Windows + \code + cmake -G "NMake Makefiles" -DDISABLE_ICU_BACKEND=ON -DCMAKE_INCLUDE_PATH=c:/boost_1_43_0 .. + \endcode + +\section binary_compatibility Binary Compatibility + +Boost.Locale is built with binary compatibility in mind. Switching localization back ends on or off, +or using iconv or not, does not affect binary compatibility. So if a dynamic library was built +with all possible backends, other dynamic libraries compiled with, for example, only the \c std, \c posix +or \c winapi backends would still be binary-compatible with it. + +However this definitely has an effect on some features. For example, if you +try to use boundary analysis or a calendar facet when the library does not support the icu backend +you would get an exception. + +*/ + + diff --git a/doc/charset_handling.txt b/doc/charset_handling.txt new file mode 100644 index 0000000..135acf4 --- /dev/null +++ b/doc/charset_handling.txt @@ -0,0 +1,143 @@ +// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 filetype=cpp.doxygen +/*! +\page charset_handling Character Set Conversions + +\section codecvt Convenience Interface + +Boost.Locale provides \ref boost::locale::conv::to_utf() "to_utf", \ref boost::locale::conv::from_utf() "from_utf" and +\ref boost::locale::conv::utf_to_utf() "utf_to_utf" functions in +the \c boost::locale::conv namespace. They are simple and +convenient functions to convert a string to and from +UTF-8/16/32 strings and strings using other encodings. + +For example: + +\code +std::string utf8_string = to_utf(latin1_string,"Latin1"); +std::wstring wide_string = to_utf(latin1_string,"Latin1"); +std::string latin1_string = from_utf(wide_string,"Latin1"); +std::string utf8_string2 = utf_to_utf(wide_string); +\endcode + + +This function may use an explicit encoding name like "Latin1" or "ISO-8859-8", +or use std::locale as a parameter to fetch this information from it. +It also receives a policy parameter that tells it how to behave if the +conversion can't be performed (i.e. an illegal or unsupported character is found). +By default this function skips all illegal characters and tries to do the best it +can, however, it is possible ask it to throw +a \ref boost::locale::conv::conversion_error "conversion_error" exception +by passing the \c stop flag to it: + +\code +std::wstring s=to_utf("\xFF\xFF","UTF-8",stop); +// Throws because this string is illegal in UTF-8 +\endcode + +\section codecvt_codecvt std::codecvt facet + +Boost.Locale provides stream codepage conversion facets based on the \c std::codecvt facet. +This allows conversion between wide-character encodings and 8-bit encodings like UTF-8, ISO-8859 or Shift-JIS. + +Most of compilers provide such facets, but: + +- Under Windows MSVC does not support UTF-8 encodings at all. +- Under Linux the encodings are supported only if the required locales are generated. For example + it may be impossible to create a \c he_IL.CP1255 locale even when the \c he_IL locale is available. + +Thus Boost.Locale provides an option to generate code-page conversion facets for use with +Boost.Iostreams filters or \c std::wfstream. For example: + +\code + std::locale loc= generator().generate("he_IL.UTF-8"); + std::wofstream file. + file.imbue(loc); + file.open("hello.txt"); + file << L"שלום!" << endl; +\endcode + +Would create a file \c hello.txt encoded as UTF-8 with "שלום!" (shalom) in it. + +\section codecvt_iostreams_integration Integration with Boost.Iostreams + +You can use the \c std::codecvt facet directly, but this is quite tricky and +requires accurate buffer and error management. + +You can use the \c boost::iostreams::code_converter class for stream-oriented +conversions between the wide-character set and narrow locale character set. + +This is a sample program that converts wide to narrow characters for an arbitrary +stream: + +\code +#include +#include +#include + +#include +#include + +namespace io = boost::iostreams; + +// Device that consumes the converted text, +// In our case it just writes to standard output +class consumer { +public: + typedef char char_type; + typedef io::sink_tag category; + std::streamsize write(const char* s, std::streamsize n) + { + std::cout.write(s,n); + return n; + } +}; + + +int main() +{ + // the device that converts wide characters + // to narrow + typedef io::code_converter converter_device; + // the stream that uses this device + typedef io::stream converter_stream; + + + consumer cons; + // setup out converter to work + // with he_IL.UTF-8 locale + converter_device dev; + boost::locale::generator gen; + dev.imbue(gen("he_IL.UTF-8")); + dev.open(cons); + converter_stream stream; + stream.open(dev); + // Now wide characters that are written + // to the stream would be given to + // our consumer as narrow characters + // in UTF-8 encoding + stream << L"שלום" << std::flush; +} + +\endcode + + +\section codecvt_limitations Limitations of std::codecvt + +The Standard does not provide any information about \c std::mbstate_t that could be used to save +intermediate code-page conversion states. It leaves the definition up to the compiler implementation, making it +impossible to reimplement std::codecvt for stateful encodings. +Thus, Boost.Locale's \c codecvt facet implementation may be used with stateless encodings like UTF-8, +ISO-8859, and Shift-JIS, but not with stateful encodings like UTF-7 or SCSU. + +\b Recommendation: Prefer the Unicode UTF-8 encoding for \c char based strings and files in your application. + +\note + +The implementation of codecvt for single byte encodings like ISO-8859-X and for UTF-8 is very efficent +and would allow fast conversion of the content, however its performance may be sub-optimal for +double-width encodings like Shift-JIS, due to the stateless problem described above. + + +*/ + + diff --git a/doc/collation.txt b/doc/collation.txt new file mode 100644 index 0000000..42a17ef --- /dev/null +++ b/doc/collation.txt @@ -0,0 +1,44 @@ + +// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 filetype=cpp.doxygen +/*! +\page collation Collation + +Boost.Locale provides a \ref boost::locale::collator "collator" class, derived from \c std::collate, that adds support for +primary, secondary, tertiary, quaternary and identical comparison levels. They can be approximately defined as: + +-# Primary -- ignore accents and character case, comparing base letters only. For example "facade" and "Façade" are the same. +-# Secondary -- ignore character case but consider accents. "facade" and "façade" are different but "Façade" and "façade" are the same. +-# Tertiary -- consider both case and accents: "Façade" and "façade" are different. Ignore punctuation. +-# Quaternary -- consider all case, accents, and punctuation. The words must be identical in terms of Unicode representation. +-# Identical -- as quaternary, but compare code points as well. + +There are two ways of using the \ref boost::locale::collator "collator" facet: directly, by calling its member functions \ref boost::locale::collator::compare() "compare", \ref boost::locale::collator::transform() "transform" and \ref +boost::locale::collator::hash() "hash", or indirectly by using the \ref boost::locale::comparator "comparator" template +class in STL algorithms. + +For example: + +\code + wstring a=L"Façade", b=L"facade"; + bool eq = 0 == use_facet >(loc).compare(collator_base::secondary,a,b); + wcout << a < > strings; + // Now strings uses the default system locale for string comparison +\endcode + +You can also set a specific locale or level when creating and using the \ref boost::locale::comparator "comparator" class: + +\code + comparator comp(some_locale,some_level); + std::map > strings(comp); +\endcode + +*/ + + diff --git a/doc/conversions.txt b/doc/conversions.txt new file mode 100644 index 0000000..92acb1d --- /dev/null +++ b/doc/conversions.txt @@ -0,0 +1,92 @@ +// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 filetype=cpp.doxygen +/*! +\page conversions Text Conversions + +There is a set of functions that perform basic string conversion operations: +upper, lower and \ref term_title_case "title case" conversions, \ref term_case_folding "case folding" +and Unicode \ref term_normalization "normalization". These are \ref boost::locale::to_upper "to_upper" , \ref boost::locale::to_lower "to_lower", \ref boost::locale::to_title "to_title", \ref boost::locale::fold_case "fold_case" and \ref boost::locale::normalize "normalize". + +All these functions receive an \c std::locale object as parameter or use a global locale by default. + +Global locale is used in all examples below. + +\section conversions_case Case Handing + +For example: +\code + std::string grussen = "grüßEN"; + std::cout <<"Upper "<< boost::locale::to_upper(grussen) << std::endl + <<"Lower "<< boost::locale::to_lower(grussen) << std::endl + <<"Title "<< boost::locale::to_title(grussen) << std::endl + <<"Fold "<< boost::locale::fold_case(grussen) << std::endl; +\endcode + +Would print: + +\verbatim +Upper GRÜSSEN +Lower grüßen +Title Grüßen +Fold grüssen +\endverbatim + +You may notice that there are existing functions \c to_upper and \c to_lower in the Boost.StringAlgo library. +The difference is that these function operate over an entire string instead of performing incorrect character-by-character conversions. + +For example: + +\code + std::wstring grussen = L"grüßen"; + std::wcout << boost::algorithm::to_upper_copy(grussen) << " " << boost::locale::to_upper(grussen) << std::endl; +\endcode + +Would give in output: + +\verbatim +GRÜßEN GRÜSSEN +\endverbatim + +Where a letter "ß" was not converted correctly to double-S in first case because of a limitation of \c std::ctype facet. + +This is even more problematic in case of UTF-8 encodings where non US-ASCII are not converted at all. +For example, this code + +\code + std::string grussen = "grüßen"; + std::cout << boost::algorithm::to_upper_copy(grussen) << " " << boost::locale::to_upper(grussen) << std::endl; +\endcode + +Would modify ASCII characters only + +\verbatim +GRüßEN GRÜSSEN +\endverbatim + +\section conversions_normalization Unicode Normalization + +Unicode normalization is the process of converting strings to a standard form, suitable for text processing and +comparison. For example, character "ü" can be represented by a single code point or a combination of the character "u" and the +diaeresis "¨". Normalization is an important part of Unicode text processing. + +Unicode defines four normalization forms. Each specific form is selected by a flag passed +to \ref boost::locale::normalize() "normalize" function: + +- NFD - Canonical decomposition - boost::locale::norm_nfd +- NFC - Canonical decomposition followed by canonical composition - boost::locale::norm_nfc or boost::locale::norm_default +- NFKD - Compatibility decomposition - boost::locale::norm_nfkd +- NFKC - Compatibility decomposition followed by canonical composition - boost::locale::norm_nfkc + +For more details on normalization forms, read this article. + +\section conversions_notes Notes + +- \ref boost::locale::normalize() "normalize" operates only on Unicode-encoded strings, i.e.: UTF-8, UTF-16 and UTF-32 depending on the + character width. So be careful when using non-UTF encodings as they may be treated incorrectly. +- \ref boost::locale::fold_case() "fold_case" is generally a locale-independent operation, but it receives a locale as a parameter to + determine the 8-bit encoding. +- All of these functions can work with an STL string, a NUL terminated string, or a range defined by two pointers. They always + return a newly created STL string. +- The length of the string may change, see the above example. +*/ + + diff --git a/doc/dates_times_timezones.txt b/doc/dates_times_timezones.txt new file mode 100644 index 0000000..bbc09ea --- /dev/null +++ b/doc/dates_times_timezones.txt @@ -0,0 +1,203 @@ +// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 filetype=cpp.doxygen +/*! +\page dates_times_timezones Working with dates, times, timezones and calendars. + +\section dates_times_timezones_intro Introduction + +There are several important flaws in the standard C, C++ and Boost libraries that handle dates and time: + +-# The biggest flaw of most libraries that provide operations over dates is the fact that they only support + the Gregorian calendar. \c boost::date_time , \c std::tm , and standard functions like \c localtime and \c gmtime, + all assume the Gregorian calendar. +-# The information about local start of week is not provided. + \n + For example the standard C and C++ library has \c mktime and \c localtime, but they do not give + user the information about the first day of week. This information is locale dependent. + It is Monday in France and it is Sunday in United States. + +Boost.Locale provides generic \ref boost::locale::date_time "date_time", and \ref boost::locale::calendar "calendar" classes +that allow you to perform operations on dates and times for non-Gregorian calendars such as Hebrew, Islamic, Japanese and others. + +\ref using_localization_backends "Non-ICU based backends" support the Gregorian calendar only. +Unlike \c boost::date_time, they are fully aware of the local first day of week. Thus, +if the current day of week is Monday, then setting "current day of week" to Sunday would move the actual date 6 days +forward in Russian or French locales and move one day backward in USA and Israeli locales. + +\section dates_times_timezones_dt Handling Dates and Time + +- \ref boost::locale::calendar -- represents generic information about the calendar, independent from a specific time point. For example, you can get the maximum number of days in a month for a specific calendar. +- \ref boost::locale::date_time -- represents a time point. It is constructed from a calendar and allows manipulation of various time periods. +- \ref boost::locale::period -- holds a list of functions that represent various periods, such as month, year, day, and hour, allowing +manipulation of dates and times. You can add periods, multiply them by integers, get or set them, or add them to +\ref boost::locale::date_time "date_time" objects. + + +For example: + +\code + using namespace boost::locale; + date_time now; // Create date_time class with default calendar initialized to current time + date_time tomorrow = now + period::day(); + cout << "Let's meet tomorrow at " << as::date << tomorrow << endl; + date_time some_point = period::year(1995) + period::january() + period::day(1); + // Set some_point's date to 1995-Jan-1. + cout << "The "<< as::date << some_point << " is the " + << as::ordinal << some_point / period::day_of_week_local() << " day of the week" << endl; +\endcode + +You can calculate the difference between dates by dividing the difference by a period: + +\code + date_time now; + cout << " There are " << (now + 2 * period::month() - now) / period::day() << " days " + "between " << as::date << now << " and " << now + 2*period::month() << endl; +\endcode + +You can also use different syntax (less operator overloading) + +\code + date_time now; + cout << " There are " << period::day(now + period::month(2) - now) << " days " + "between " << as::date << now << " and " << now + period::month(2) << endl; +\endcode + + + +\ref boost::locale::date_time "date_time" -- provides the member functions \ref boost::locale::date_time::minimum() "minimum" and +\ref boost::locale::date_time::maximum() "maximum" to get the information about smallest and largest +possible values of a certain period for a specific time. + +For example, for February the maximum(period::day()) would be 28 (or 29 for a leap year), and for January it would be 31. + +\note Be very careful with assumptions about calendars. For example, in the Hebrew calendar, the +number of months is different for leap years and non-leap years. + +We recommend you to look at the \c calendar.cpp example provided with this library to get an understanding of how +to manipulate dates and times using these classes. + +To convert between various calendar dates, you may get the current POSIX time via the +\ref boost::locale::date_time::time "time" member function. + +For example: + +\code + using namespace boost::locale; + using namespace boost::locale::period; + generator gen; + // Create locales with Hebrew and Gregorian (default) calendars. + std::locale l_hebrew=gen("en_US.UTF-8@calendar=hebrew"); + std::locale l_gregorian=gen("en_US.UTF-8"); + + // Create a Gregorian date from fields + date_time greg(year(2010) + february() + day(5),l_gregorian); + // Assign a time point taken from the Gregorian date to date_time with + // the Hebrew calendar + date_time heb(greg.time(),l_hebrew); + // Now we can query the year. + std::cout << "Hebrew year is " << heb / year << std::endl; +\endcode + +\note + +Non-ICU based backends support the same date-time range as \c mktime and \c localtime C library functions. + +- Unix 32 bit: dates between 1901 and 2038 +- Unix 64 bit: dates from 1 BC +- Windows: dates from 1970. If the \c time_t is 32 bits wide (mingw), then the upper limit is year 2038 + +\section dates_times_timezones_tz Time Zone + +The current operating system's time zone is used by default, however the time zone can be modified at +several different levels: + +-# Calendar level: you can specify a timezone when creating a new instance of \ref boost::locale::calendar + in its constructor. +-# iostream level: you can use \ref boost::locale::as::time_zone "as::time_zone" manipulator to set a specific + time zone to the iostream so all dates and times would be represented in this time zone +-# You can specify the default global time zone by calling: \ref boost::locale::time_zone::global(std::string const &). + This time zone would be the default one for newly created iostream object and calendar instances. + +\note + +\ref using_localization_backends "Non-ICU based backends" support only two kinds of time zones: + +-# The current OS time zone, as it is handled by \c localtime and \c mktime the standard + library functions - the default time zone +-# Simple time zone in format "GMT+HH:MM" - the time zone represented using fixed shift from + the UTC without support of daylight saving time. + + +\section dates_times_timezones_io I/O Operations on date_time objects + +Writing a \ref boost::locale::date_time "date_time" is equivalent +to: + +- Applying \ref boost::locale::as::datetime "as::datetime" manipulator on the stream +- Writing POSIX time as number that is fetched by calling \ref boost::locale::date_time::time() + "date_time::time()" function. +- Reverting the manipulator effect back. + +For example this code: + +\code +using namespace boost::locale; +date_time now; +std::cout << now << std::endl; +\endcode + +Would print in the default format, something like: + +\verbatim +2/3/2011 12:00 am +\endverbatim + +However if you need to change the default behavior (for example show only date), +then you need to use specific iostream manipulator in order to display current date or time, +it would override the default formatting. + +For example + +\code +using namespace boost::locale; +date_time now; +std::cout << as::date << now << std::endl; +\endcode + +Would print something like: + +\verbatim +2/3/2011 +\endverbatim + +This is important to remember that \c date_time object is always rendered and parsed in the context +of the \c iostream's locale and time zone and not in the context of specific \c date_time object. + +\section dates_times_timezones_qna Questions and Answers + + +Why should I use Boost.Locale over Boost.DateTime when I need Gregorian calendar only? + +- Boost.DateTime is locale agnostic library and ignores the fact that the first day of week + varies by the locale. +- Boost.Locale provides a unified access to date and time in time zone aware way. + It represents a time as universal scalar - the POSIX time and over that builds dates, + local times and time-zones handling. + \n + For example, date_time(some_time.time() + 3600) may be not equal to + some_time + hour(), because of the daylight savings time. + +Why don't you use Boost.DateTime time zone support? + +Boost.DateTime's time zone support is broken. Time zones can not be represented with +a simple table of rules where daylight saving depend only on certain n'th day of week in month. +The daylight savings time may vary by year, political issues and many other things. + +Most of the modern operating systems (Linux, *BSD, Mac OS X, OpenVMS) and many important software packages +(ICU, Java, Python) use so called Olson database in order to handle daylight saving time +correctly. + +If you need full time zone database support, then you should use ICU library. + +*/ + + diff --git a/doc/default_encoding_under_windows.txt b/doc/default_encoding_under_windows.txt new file mode 100644 index 0000000..a746aaa --- /dev/null +++ b/doc/default_encoding_under_windows.txt @@ -0,0 +1,57 @@ +// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 filetype=cpp.doxygen +/*! +\page default_encoding_under_windows Default Encoding under Microsoft Windows + +All modern operating systems use Unicode. + +- Unix operating system family use UTF-8 encoding by default. +- Microsoft Windows had migrated to Wide/UTF-16 API. + The narrow encodings had been deprecated and the native OS API became so called "Wide API" + +As a result of radically different approaches, it is very hard to write portable Unicode aware applications. + +Boost Locale fully supports both narrow and wide API. The default character +encoding is assumed to be UTF-8 on Windows. + +So if the default operating system Locale is "English_USA.1252" the default +locale for Boost.Locale on Windows would be "en_US.UTF-8". + +When the created locale object is installed globally then any libraries +that use \c std::codecvt for conversion between narrow API and the native +wide API would handle UTF-8 correctly. + +A good example of such library is Boost.Filesystem v3. + +For example + +\code +#include +#include +#include + +int main() +{ + // Create and install global locale + std::locale::global(boost::locale::generator().generate("")); + // Make boost.filesystem use it + boost::filesystem::path::imbue(std::locale()); + // Now Works perfectly fine with UTF-8! + boost::filesystem::ofstream hello("שלום.txt"); +} + +\endcode + +However such behavior may break existing software that assumes that the current +encoding is single byte encodings like code page 1252. + +\ref boost::locale::generator class has a property \ref boost::locale::generator::use_ansi_encoding() "use_ansi_encoding()" +that allows to change the behavior to legacy one and select an ANSI code page as +default system encoding. + +So, when the current locale is "English_USA.1252" and the \c use_ansi_encoding is turned on +then the default locale would be "en_US.windows-1252" + +\note \c winapi backend does not support ANSI encodings, thus UTF-8 encoding is always used for narrow characters. + +*/ + diff --git a/doc/faq.txt b/doc/faq.txt new file mode 100644 index 0000000..05bb455 --- /dev/null +++ b/doc/faq.txt @@ -0,0 +1,42 @@ +// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 filetype=cpp.doxygen +/*! +\page faq Frequently Asked Questions + +- \anchor faq_bad_cast I try to use some Boost.Locale functions and I get an \c std::bad_cast exception thrown? + \n + \n + \b Answer: You probably try to use incorrect \c std::locale object. All Boost.Locale tools relay on \c std::locale object's facets. + The locale object should be generated with \ref boost::locale::generator "generator" class and then passed to + the function or alternatively global locale should be set using \c std::locale::global() function such that + global locale (and default created one) would have required facets to use. +- \anchor faq_number I had installed global locale and try to write something to stream but still get wrong output? + For example: + \code + #include + #include + int main() + { + boost::locale::generator gen; + std::locale::global(gen("")); + std::cout << boost::locale::as::date << std::time(0) << std::endl; + } + \endcode + Prints a number instead of a date. + \n + \b Answer: You forget to imbue the locale to the stream. Changing the global locale does not affect the + locale in existing \c iostream objects. Thus because \c std::out and other global streams were created + before changing the global locale Boost.Locale manipulators have no effect. You need to write: + \code + #include + #include + int main() + { + boost::locale::generator gen; + std::locale l = gen(""); + std::locale::global(l); + std::cout.imbue(l); + std::cout << boost::locale::as::date << std::time(0) << std::endl; + } + \endcode + +*/ diff --git a/doc/footer.html b/doc/footer.html new file mode 100644 index 0000000..67ba1e1 --- /dev/null +++ b/doc/footer.html @@ -0,0 +1,5 @@ + + + diff --git a/doc/formatting_and_parsing.txt b/doc/formatting_and_parsing.txt new file mode 100644 index 0000000..a3b6831 --- /dev/null +++ b/doc/formatting_and_parsing.txt @@ -0,0 +1,154 @@ +// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 filetype=cpp.doxygen +/*! + +\page formatting_and_parsing Numbers, Time and Currency formatting and parsing + +All formatting and parsing is performed via the standard I/O streams. Each of the above information types is represented as a number. +The formatting information is set using iostream manipulators. All manipulators are placed in the boost::locale::as namespace. + +For example: + +\code + cout << as::currency << 123.45 << endl; + // display 123.45 in local currency representation. + cin >> as::currency >> x ; + // Parse currency representation and store it in x +\endcode + +There is a special manipulator \c as::posix that "unsets" locale-specific settings and returns them to the default \c iostream formatting +and parsing methods. Please note, such formats may still be localized by the default \c std::num_put and \c std::num_get facets. + +\section numbers_formatting Numbers and number manipulators + +Here are the manipulators for number formatting: + +- \c as::number -- format number according to local specifications, it takes into account various \c std::ios_base flags like scientific + format and precision. + \n +- \c as::percent -- format number as "percent" format. For example: + \code + cout << as::percent << 0.25 <CppCMS project (where the Boost.Locale was developed originally) +- Download the a set of packages from MinGW project +- Build it on your own +- Use Cygwin's packages + +\section gettext_for_windows_cppcms Getting gettext utilities from CppCMS project + +Boost.Locale was developed for needs of CppCMS project +and thus CppCMS hosts a convince package for Windows users of pre-build, statically liked \c gettext +runtime utilities like \c xgettext, \c msgfmt, etc. + +So you can download a zip file \c gettext-tools-static-XXX.zip from a CppCMS downloads page +under boost_locale/gettext_for_windows. + +Extract the file and use the executable files inside. + +\section gettext_for_windows_mingw Getting Gettext via MinGW project + +MinGW project provides GNU tools for Windows, including GNU compilers and various runtime utilities. +Thus you can always install full MinGW distribution including gettext tools. However, if you +a want minimalistic runtime version that allows you to extract messages and create catalogs +you need to download several packages manually. + +In order to install Gettext via MinGW distributing you need to download, a GCC's runtime, +iconv library and gettext itself. + +So visit a downloads page of MinGW project +and download following files (chose the latest versions of each package): + +- From: \c MinGW/BaseSystem/GCC/Version4/gcc-xxx/ \n + File: \c libgcc-xxx-mingw32-dll-1.tar.lzma +- From \c MinGW/Gettext/gettext-yyy/ \n + Files: \c gettext-yyy-mingw32-dev.tar.lzma, + \c libgettextpo-yyy-mingw32-dll-0.tar.lzma, + \c libintl-yyy-mingw32-dll-8.tar.lzma +- From \c MinGW/libiconv/libiconv-zzz/ \n + Files: \c libiconv-zzz-mingw32-dll-2.tar.lzma, \c libcharset-zzz-mingw32-dll-1.tar.lzma + +For example, at June 23, 2011 it was: + +- GNU Runtime: \c libgcc-4.5.2-1-mingw32-dll-1.tar.lzma +- \c iconv: \c libiconv-1.13.1-1-mingw32-dll-2.tar.lzma and \c libcharset-1.13.1-1-mingw32-dll-1.tar.lzma +- \c gettext: \c libintl-0.17-1-mingw32-dll-8.tar.lzma, \c libgettextpo-0.17-1-mingw32-dll-0.tar.lzma and \c gettext-0.17-1-mingw32-dev.tar.lzma. + +After you download the packages, extract all the files to the same directory using tools like +\c 7zip and you'll get all the executables and \c dll's you need under \c bin subdirectory. + +\note the version on MinGW site is slightly outdated (0.17.1) while gettext provides currently 0.18.1. + +\section gettext_for_windows_build Building latest version on your own. + +You can build your own version of GNU Gettext using MinGW environment, you'll need to have up-to-date gcc compiler +and the shell, you'll need to install iconv first and then build a gettext with it. + +Basic and simplest way would be to open a MinGW shell + +Build \c iconv: + +\code +cd libiconv-SOMEVERSION +./configure --prefix=c:/mygettext --disable-shared +make +make install +cd .. +cd gettext-SOMEVERSION +./configure --prefix=c:/mygettext --disable-shared --with-libiconv-prefix=c:/mygettext +make +make install +\endcode + +And now you have in c:\\mygettext\\bin all appropriate executable files +to use. + +\section gettext_for_windows_cygwin Using Cygwin + +If you already have Cygwin - just use gettext tools provided with it. + +*/ + + diff --git a/doc/glossary.txt b/doc/glossary.txt new file mode 100644 index 0000000..bb26214 --- /dev/null +++ b/doc/glossary.txt @@ -0,0 +1,71 @@ +// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 filetype=cpp.doxygen +/*! +\page glossary Glossary + +- \anchor term_bmp Basic Multilingual Plane (BMP) -- a part of + the Universal Character Set with code points in the range U-0000--U-FFFF. + The most commonly used UCS characters lay in this plane, including all Western, Cyrillic, Hebrew, Thai, Arabic and CJK characters. + However there are many characters that lay outside the BMP and they are absolutely required for correct support of East Asian languages. +- \b Code \b Point -- a unique number that represents a "character" in the Universal Character Set. Code points lay in the range of + 0-0x10FFFF, and are usually displayed as U+XXXX or U+XXXXXX, where X represents a hexadecimal digit. +- \anchor term_collation \b Collation -- a sorting order for text, usually alphabetical. It can differ between languages and countries, even for the same + characters. +- \b Encoding - a representation of a character set. Some encodings are capable of representing the full UCS range, like UTF-8, and + others can only represent a subset of it -- ISO-8859-8 represents only a small subset of about 250 characters of the UCS. + \n + Non-Unicode encodings are still very popular, for example the Latin-1 (or ISO-8859-1) encoding covers most of the characters for + Western European languages and significantly simplifies the processing of text for applications designed to handle only such languages. + \n + For Boost.Locale you should provide an eight-bit (\c std::string) encoding as part of the locale name, like \c en_US.UTF-8 or + \c he_IL.cp1255 . \c UTF-8 is recommended. +- \b Facet - or \c std::locale::facet -- a base class that every object that describes a specific locale is derived from. Facets can be + added to a locale to provide additional culture information. +- \b Formatting - representation of various values according to locale preferences. For example, a number 1234.5 (C representation) + should be displayed as 1,234.5 in the US locale and 1.234,5 in the Russian locale. The date November 1st, 2005 would be represented as + 11/01/2005 in the United States, and 01.11.2005 in Russia. This is an important part of localization. + \n + For example: does "You have to bring 134,230 kg of rice on 04/01/2010" means "134 tons of rice on the first of April" or "134 kg 230 g + of rice on January 4th"? That is quite different. +- \b Gettext - The GNU localization library used for message formatting. Today it is the de-facto standard localization library in the + Open Source world. Boost.Locale message formatting is entirely built on Gettext message catalogs. +- \b Locale - a set of parameters that define specific preferences for users in different cultures. It is generally defined by language, + country, variants, and encoding, and provides information like: collation order, date-time formatting, message formatting, number + formatting and many others. In C++, locale information is represented by the \c std::locale class. +- \b Message \b Formatting -- the representation of user interface strings in the user's language. The process of translation of UI + strings is generally done using some dictionary provided by the program's translator. +- \b Message \b Domain -- in \a gettext terms, the keyword that represents a message catalog. This is usually an application name. When + \a gettext and Boost.Locale search for a specific message catalog, they search in the specified path for a file named after the domain. +- \anchor term_normalization + \b Normalization - Unicode normalization is the process of converting strings to a standard form, suitable for text processing and + comparison. For example, character "ü" can be represented by a single code point or a combination of the character "u" and the + diaeresis "¨". Normalization is an important part of Unicode text processing. + \n + Normalization is not locale-dependent, but because it is an important part of Unicode processing, it is included in the Boost.Locale + library. +- \b UCS-2 - a fixed-width Unicode encoding, capable of representing only code points in the Basic Multilingual Plane (BMP). + It is a legacy encoding and is not recommended for use. +- \b Unicode -- the industry standard that defines the representation and manipulation of text suitable for most languages and countries. + It should not be confused with the Universal Character Set, it is a much larger standard that also defines algorithms like + bidirectional display order, Arabic shaping, etc. +- Universal Character Set (UCS) - an international standard that defines a set of characters for many scripts and their + \a code \a points. +- \b UTF-8 - a variable-width Unicode transformation format. Each UCS code point is represented as a sequence of between 1 and 4 octets + that can be easily distinguished. It includes ASCII as a subset. It is the most popular Unicode encoding for web applications, data + transfer and storage, and is the de-facto standard encoding for most POSIX operation systems. +- \b UTF-16 - a variable-width Unicode transformation format. Each UCS code point is represented as a sequence of one or two 16-bit words. + It is a very popular encoding for platforms such as the Win32 API, Java, C#, Python, etc. However, it is frequently confused with the + _UCS-2_ fixed-width encoding, which can only represent characters in the Basic Multilingual Plane (BMP). + \n + This encoding is used for \c std::wstring under the Win32 platform, where sizeof(wchar_t)==2. +- \b UTF-32/UCS-4 - a fixed-width Unicode transformation format, where each code point is represented as a single 32-bit word. It has + the advantage of simple code point representation, but is wasteful in terms of memory usage. It is used for \c std::wstring encoding + for most POSIX platforms, where sizeof(wchar_t)==4. +- \anchor term_case_folding Case Folding - is a process of converting a text to case independent representation. + For example case folding for a word "Grüßen" is "grüssen" - where the letter "ß" is represented in case independent way as "ss". +- \anchor term_title_case Title Case - + Is a text conversion where the words are capitalized. For example "hello world" is converted + to "Hello World" + +*/ + + diff --git a/doc/header.html b/doc/header.html new file mode 100644 index 0000000..7d02321 --- /dev/null +++ b/doc/header.html @@ -0,0 +1,47 @@ + + + + +$title + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
diff --git a/doc/html/annotated.html b/doc/html/annotated.html new file mode 100644 index 0000000..248143e --- /dev/null +++ b/doc/html/annotated.html @@ -0,0 +1,115 @@ + + + + +Boost.Locale: Class List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Class List

+
+
+Here are the classes, structs, unions and interfaces with brief descriptions: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
boost::locale::abstract_calendar
boost::locale::util::base_converterThis class represent a simple stateless converter from UCS-4 and to UCS-4 for each single code point
boost::locale::basic_format< CharType >Printf like class that allows type-safe and locale aware message formatting
boost::locale::basic_message< CharType >This class represents a message that can be converted to a specific locale message
boost::locale::boundary::boundary_indexing< Char >This facet generates an index for boundary analysis for a given text
boost::locale::boundary::boundary_point< IteratorType >This class represents a boundary point in the text
boost::locale::boundary::boundary_point_index< BaseIterator >This class holds an index of boundary points and allows iterating over them
boost::locale::boundary::break_infoThis structure is used for representing boundary point that follows the offset
boost::locale::calendarThis class provides an access to general calendar information
boost::locale::calendar_facetFacet that generates calendar for specific locale
boost::locale::collator< CharType >Collation facet
boost::locale::collator_baseBase class that includes collation level flags
boost::locale::comparator< CharType, default_level >This class can be used in STL algorithms and containers for comparison of strings with a level other than primary
boost::locale::conv::conversion_errorThe excepton that is thrown in case of conversion error
boost::locale::converter< Char >The facet that implements text manipulation
boost::locale::converter_baseThis class provides base flags for text manipulation. It is used as base for converter facet
boost::locale::date_timeThis class represents a date time and allows to perform various operation according to the locale settings
boost::locale::date_time_durationThis class represents a period: a pair of two date_time objects
boost::locale::date_time_errorThis error is thrown in case of invalid state that occurred
boost::locale::date_time_periodThis class represents a pair of period_type and the integer values that describes its amount. For example 3 days or 4 years
boost::locale::date_time_period_setThis class that represents a set of periods,
boost::locale::gnu_gettext::messages_info::domainThis type represents GNU Gettext domain name for the messages
boost::locale::generatorMajor class used for locale generation
boost::locale::hold_ptr< T >Smart pointer similar to std::auto_ptr but it is non-copyable and the underlying object has the same constness as the pointer itself (unlike an ordinary pointer)
boost::locale::infoFacet that holds general information about locale
boost::locale::conv::invalid_charset_errorThis exception is thrown in case of use of unsupported or invalid character set
boost::locale::ios_infoThis class holds an external data - beyond existing fmtflags that std::ios_base holds
boost::locale::localization_backendThis class represents a localization backend that can be used for localizing your application
boost::locale::localization_backend_managerLocalization backend manager is a class that holds various backend and allows creation of their combination or selection
boost::locale::message_format< CharType >This facet provides message formatting abilities
boost::locale::gnu_gettext::messages_infoThis structure holds all information required for creating gnu-gettext message catalogs,
boost::locale::period::period_typeThis class holds a type that represents certain period of time like year, hour, second and so on
boost::locale::posix_time
boost::locale::boundary::segment< IteratorType >Segment object that represents a pair of two iterators that define the range where this segment exits and a rule that defines it
boost::locale::boundary::segment_index< BaseIterator >This class holds an index of segments in the text range and allows to iterate over them
+
+ + + diff --git a/doc/html/appendix.html b/doc/html/appendix.html new file mode 100644 index 0000000..4527dc6 --- /dev/null +++ b/doc/html/appendix.html @@ -0,0 +1,89 @@ + + + + +Boost.Locale: Appendix + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Appendix

+
+ + + + diff --git a/doc/html/bc_s.png b/doc/html/bc_s.png new file mode 100644 index 0000000..e401862 Binary files /dev/null and b/doc/html/bc_s.png differ diff --git a/doc/html/boundary_8cpp-example.html b/doc/html/boundary_8cpp-example.html new file mode 100644 index 0000000..118a7c3 --- /dev/null +++ b/doc/html/boundary_8cpp-example.html @@ -0,0 +1,143 @@ + + + + +Boost.Locale: boundary.cpp + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boundary.cpp

+
+
+

Example of using segment_index

+
//
+//  Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
+//
+//  Distributed under the Boost Software License, Version 1.0. (See
+//  accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+//
+#include <boost/locale.hpp>
+#include <iostream>
+#include <cassert>
+#include <ctime>
+
+int main()
+{
+    using namespace boost::locale;
+    using namespace std;
+
+    generator gen;
+    // Make system default locale global
+    std::locale loc = gen("");
+    locale::global(loc); 
+    cout.imbue(loc);
+    
+
+    string text="Hello World! あにま! Linux2.6 and Windows7 is word and number. שָלוֹם עוֹלָם!";
+
+    cout<<text<<endl;
+
+    boundary::ssegment_index index(boundary::word,text.begin(),text.end());
+    boundary::ssegment_index::iterator p,e;
+
+    for(p=index.begin(),e=index.end();p!=e;++p) {
+        cout<<"Part ["<<*p<<"] has ";
+        if(p->rule() & boundary::word_number)
+            cout<<"number(s) ";
+        if(p->rule() & boundary::word_letter)
+            cout<<"letter(s) ";
+        if(p->rule() & boundary::word_kana)
+            cout<<"kana character(s) ";
+        if(p->rule() & boundary::word_ideo)
+            cout<<"ideographic character(s) ";
+        if(p->rule() & boundary::word_none)
+            cout<<"no word characters";
+        cout<<endl;
+    }
+
+    index.map(boundary::character,text.begin(),text.end());
+
+    for(p=index.begin(),e=index.end();p!=e;++p) {
+        cout<<"|" <<*p ;
+    }
+    cout<<"|\n\n";
+
+    index.map(boundary::line,text.begin(),text.end());
+
+    for(p=index.begin(),e=index.end();p!=e;++p) {
+        cout<<"|" <<*p ;
+    }
+    cout<<"|\n\n";
+
+    index.map(boundary::sentence,text.begin(),text.end());
+
+    for(p=index.begin(),e=index.end();p!=e;++p) {
+        cout<<"|" <<*p ;
+    }
+    cout<<"|\n\n";
+    
+}
+
+// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
+
+ + + + diff --git a/doc/html/boundary_8hpp_source.html b/doc/html/boundary_8hpp_source.html new file mode 100644 index 0000000..7ab5685 --- /dev/null +++ b/doc/html/boundary_8hpp_source.html @@ -0,0 +1,94 @@ + + + + +Boost.Locale: boost/locale/boundary.hpp Source File + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + diff --git a/doc/html/boundary__point_8hpp_source.html b/doc/html/boundary__point_8hpp_source.html new file mode 100644 index 0000000..84de565 --- /dev/null +++ b/doc/html/boundary__point_8hpp_source.html @@ -0,0 +1,187 @@ + + + + +Boost.Locale: boost/locale/boundary/boundary_point.hpp Source File + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + diff --git a/doc/html/boundary_analysys.html b/doc/html/boundary_analysys.html new file mode 100644 index 0000000..626e7e6 --- /dev/null +++ b/doc/html/boundary_analysys.html @@ -0,0 +1,386 @@ + + + + +Boost.Locale: Boundary analysis + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Boundary analysis

+
+
+ +

+Basics

+

Boost.Locale provides a boundary analysis tool, allowing you to split text into characters, words, or sentences, and find appropriate places for line breaks.

+
Note:
This task is not a trivial task.
+
A Unicode code point and a character are not equivalent, for example: Hebrew word Shalom - "שָלוֹם" that consists of 4 characters and 6 code points (4 base letters and 2 diacritical marks)
+
Words may not be separated by space characters in some languages like in Japanese or Chinese.
+

Boost.Locale provides 2 major classes for boundary analysis:

+ +

Each of the classes above use an iterator type as template parameter. Both of these classes accept in their constructor:

+
    +
  • A flag that defines boundary analysis boundary_type.
  • +
  • The pair of iterators that define the text range that should be analysed
  • +
  • A locale parameter (if not given the global one is used)
  • +
+

For example:

+
namespace ba=boost::locale::boundary;
+std::string text= ... ;
+std::locale loc = ... ;
+ba::segment_index<std::string::const_iterator> map(ba::word,text.begin(),text.end(),loc);
+

Each of them provide a members begin(), end() and find() that allow to iterate over the selected segments or boundaries in the text or find a location of a segment or boundary for given iterator.

+

Convenience a typedefs like ssegment_index or wcboundary_point_index provided as well, where "w", "u16" and "u32" prefixes define a character type wchar_t, char16_t and char32_t and "c" and "s" prefixes define whether std::basic_string<CharType>::const_iterator or CharType const * are used.

+

+Iterating Over Segments

+

+Basic Iteration

+

The text segments analysis is done using segment_index class.

+

It provides a bidirectional iterator that returns segment object. The segment object represents a pair of iterators that define this segment and a rule according to which it was selected. It can be automatically converted to std::basic_string object.

+

To perform boundary analysis, we first create an index object and then iterate over it:

+

For example:

+
using namespace boost::locale::boundary;
+boost::locale::generator gen;
+std::string text="To be or not to be, that is the question."
+// Create mapping of text for token iterator using global locale.
+ssegment_index map(word,text.begin(),text.end(),gen("en_US.UTF-8")); 
+// Print all "words" -- chunks of word boundary
+for(ssegment_index::iterator it=map.begin(),e=map.end();it!=e;++it)
+    std::cout <<"\""<< * it << "\", ";
+std::cout << std::endl;
+

Would print:

+
+"To", " ", "be", " ", "or", " ", "not", " ", "to", " ", "be", ",", " ", "that", " ", "is", " ", "the", " ", "question", ".",
+

This sentence "生きるか死ぬか、それが問題だ。" (from Tatoeba database) would be split into following segments in ja_JP.UTF-8 (Japanese) locale:

+
+"生", "きるか", "死", "ぬか", "、", "それが", "問題", "だ", "。", 
+

The boundary analysis that is done by Boost.Locale is much more complicated then just splitting the text according to white space characters.

+

Of course it may be not per

+

+Using Rules

+

The segments selection can be customized using rule() and full_select() member functions.

+

By default segment_index's iterator return each text segment defined by two boundary points regardless the way they were selected. Thus in the example above we could see text segments like "." or " " that were selected as words.

+

Using a rule() member function we can specify a binary mask of rules we want to use for selection of the boundary points using word, line and sentence boundary rules.

+

For example, by calling

+
map.rule(word_any);
+

Before starting the iteration process, specify a selection mask that fetches: numbers, letter, Kana letters and ideographic characters ignoring all non-word related characters like white space or punctuation marks.

+

So the code:

+
using namespace boost::locale::boundary;
+std::string text="To be or not to be, that is the question."
+// Create mapping of text for token iterator using global locale.
+ssegment_index map(word,text.begin(),text.end()); 
+// Define a rule
+map.rule(word_any);
+// Print all "words" -- chunks of word boundary
+for(ssegment_index::iterator it=map.begin(),e=map.end();it!=e;++it)
+    std::cout <<"\""<< * it << "\", ";
+std::cout << std::endl;
+

Would print:

+
+"To", "be", "or", "not", "to", "be", "that", "is", "the", "question",
+

And the for given text="生きるか死ぬか、それが問題だ。" and rule(word_ideo), the example above would print.

+
+"生", "死", "問題",
+

You can access specific rules the segments where selected it using segment::rule() member function. Using a bit-mask of rules.

+

For example:

+
boost::locale::generator gen;
+using namespace boost::locale::boundary;
+std::string text="生きるか死ぬか、それが問題だ。";
+ssegment_index map(word,text.begin(),text.end(),gen("ja_JP.UTF-8")); 
+for(ssegment_index::iterator it=map.begin(),e=map.end();it!=e;++it) {
+    std::cout << "Segment " << *it << " contains: ";
+    if(it->rule() & word_none)
+        std::cout << "white space or punctuation marks ";
+    if(it->rule() & word_kana)
+        std::cout << "kana characters ";
+    if(it->rule() & word_ideo)
+        std::cout << "ideographic characters";
+    std::cout<< std::endl;
+}
+

Would print

+
+Segment 生 contains: ideographic characters
+Segment きるか contains: kana characters 
+Segment 死 contains: ideographic characters
+Segment ぬか contains: kana characters 
+Segment 、 contains: white space or punctuation marks 
+Segment それが contains: kana characters 
+Segment 問題 contains: ideographic characters
+Segment だ contains: kana characters 
+Segment 。 contains: white space or punctuation marks 
+

One important things that should be noted that each segment is defined by a pair of boundaries and the rule of its ending point defines if it is selected or not.

+

In some cases it may be not what we actually look like.

+

For example we have a text:

+
+Hello! How
+are you?
+

And we want to fetch all sentences from the text.

+

The sentence rules have two options:

+
    +
  • Split the text on the point where sentence terminator like ".!?" detected: sentence_term
  • +
  • Split the text on the point where sentence separator like "line feed" detected: sentence_sep
  • +
+

Naturally to ignore sentence separators we would call segment_index::rule(rule_type v) with sentence_term parameter and then run the iterator.

+
boost::locale::generator gen;
+using namespace boost::locale::boundary;
+std::string text=   "Hello! How\n"
+                    "are you?\n";
+ssegment_index map(sentence,text.begin(),text.end(),gen("en_US.UTF-8")); 
+map.rule(sentence_term);
+for(ssegment_index::iterator it=map.begin(),e=map.end();it!=e;++it) 
+    std::cout << "Sentence [" << *it << "]" << std::endl;
+

However we would get the expected segments:

+
+Sentence [Hello! ]
+Sentence [are you?
+]
+

The reason is that "How\n" is still considered a sentence but selected by different rule.

+

This behavior can be changed by setting segment_index::full_select(bool) to true. It would force iterator to join the current segment with all previous segments that may not fit the required rule.

+

So we add this line:

+
map.full_select(true);
+

Right after "map.rule(sentence_term);" and get expected output:

+
+Sentence [Hello! ]
+Sentence [How
+are you?
+]
+

+Locating Segments

+

Sometimes it is useful to find a segment that some specific iterator is pointing on.

+

For example a user had clicked at specific point, we want to select a word on this location.

+

segment_index provides find(base_iterator p) member function for this purpose.

+

This function returns the iterator to the segmet such that p points to.

+

For example:

+
text="to be or ";
+ssegment_index map(word,text.begin(),text.end(),gen("en_US.UTF-8"));
+ssegment_index::iterator  p = map.find(text.begin() + 4);
+if(p!=map.end())
+    std::cout << *p << std::endl;
+

Would print:

+
+be
+
Note:
+

if the iterator lays inside the segment this segment returned. If the segment does not fit the selection rules, then the segment following requested position is returned.

+

For example: For word boundary analysis with word_any rule:

+
    +
  • "t|o be or ", would point to "to" - the iterator in the middle of segment "to".
  • +
  • "to |be or ", would point to "be" - the iterator at the beginning of the segment "be"
  • +
  • "to| be or ", would point to "be" - the iterator does is not point to segment with required rule so next valid segment is selected "be".
  • +
  • "to be or| ", would point to end as not valid segment found.
  • +
+

+Iterating Over Boundary Points

+

+Basic Iteration

+

The boundary_point_index is similar to segment_index in its interface but as a different role. Instead of returning text chunks (segments, it returns boundary_point object that represents a position in text - a base iterator used that is used for iteration of the source text C++ characters. The boundary_point object also provides a rule() member function that defines a rule this boundary was selected according to.

+
Note:
The beginning and the ending of the text are considered boundary points, so even an empty text consists of at least one boundary point.
+

Lets see an example of selecting first two sentences from a text:

+
using namespace boost::locale::boundary;
+boost::locale::generator gen;
+
+// our text sample
+std::string const text="First sentence. Second sentence! Third one?";
+// Create an index 
+sboundary_point_index map(sentence,text.begin(),text.end(),gen("en_US.UTF-8"));
+
+// Count two boundary points
+sboundary_point_index::iterator p = map.begin(),e=map.end();
+int count = 0;
+while(p!=e && count < 2) {
+    ++count;
+    ++p;
+}
+
+if(p!=e) {
+    std::cout   << "First two sentences are: " 
+                << std::string(text.begin(),p->iterator()) 
+                << std::endl;
+}
+else {
+    std::cout   <<"There are less then two sentences in this "
+                <<"text: " << text << std::endl;
+}
+

Would print:

+
+First two sentences are: First sentence. Second sentence!
+

+Using Rules

+

Similarly to the segment_index the boundary_point_index provides a rule(rule_type mask) member function to filter boundary points that interest us.

+

It allows to set word, line and sentence rules for filtering boundary points.

+

Lets change an example above a little:

+
// our text sample
+std::string const text= "First sentence. Second\n"
+                        "sentence! Third one?";
+

If we run our program as is on the sample above we would get:

+
+First two sentences are: First sentence. Second
+

Which is not something that we really expected. As the "Second\n" is considered an independent sentence that was separated by a line separator "Line Feed".

+

However, we can set set a rule sentence_term and the iterator would use only boundary points that are created by a sentence terminators like ".!?".

+

So by adding:

+
map.rule(sentence_term);
+

Right after the generation of the index we would get the desired output:

+
+First two sentences are: First sentence. Second
+sentence! 
+

You can also use boundary_point::rule() member function to learn about the reason this boundary point was created by comparing it with an appropriate mask.

+

For example:

+
using namespace boost::locale::boundary;
+boost::locale::generator gen;
+// our text sample
+std::string const text= "First sentence. Second\n"
+                        "sentence! Third one?";
+sboundary_point_index map(sentence,text.begin(),text.end(),gen("en_US.UTF-8"));
+
+for(sboundary_point_index::iterator p = map.begin(),e=map.end();p!=e;++p) {
+    if(p->rule() & sentence_term)
+        std::cout << "There is a sentence terminator: ";
+    else if(p->rule() & sentence_sep)
+        std::cout << "There is a sentence separator: ";
+    if(p->rule()!=0) // print if some rule exists
+        std::cout   << "[" << std::string(text.begin(),p->iterator()) 
+                    << "|" << std::string(p->iterator(),text.end()) 
+                    << "]\n";
+}
+

Would give the following output:

+
+There is a sentence terminator: [First sentence. |Second
+sentence! Third one?]
+There is a sentence separator: [First sentence. Second
+|sentence! Third one?]
+There is a sentence terminator: [First sentence. Second
+sentence! |Third one?]
+There is a sentence terminator: [First sentence. Second
+sentence! Third one?|]
+

+Locating Boundary Points

+

Sometimes it is useful to find a specific boundary point according to given iterator.

+

boundary_point_index provides a iterator find(base_iterator p) member function.

+

It would return an iterator to a boundary point on p's location or at the location following it if p does not point to appropriate position.

+

For example, for word boundary analysis:

+
    +
  • If a base iterator points to "to |be", then the returned boundary point would be "to |be" (same position)
  • +
  • If a base iterator points to "t|o be", then the returned boundary point would be "to| be" (next valid position)
  • +
+

For example if we want to select 6 words around specific boundary point we can use following code:

+
using namespace boost::locale::boundary;
+boost::locale::generator gen;
+// our text sample
+std::string const text= "To be or not to be, that is the question.";
+
+// Create a mapping
+sboundary_point_index map(word,text.begin(),text.end(),gen("en_US.UTF-8"));
+// Ignore wite space
+map.rule(word_any);
+
+// define our arbitraty point
+std::string::const_iterator pos = text.begin() + 12; // "no|t";
+
+// Get the search range
+sboundary_point_index::iterator 
+    begin =map.begin(),
+    end = map.end(),
+    it = map.find(pos); // find a boundary
+
+// go 3 words backward
+for(int count = 0;count <3 && it!=begin; count ++) 
+    --it;
+
+// Save the start
+std::string::const_iterator start = *it;
+
+// go 6 words forward
+for(int count = 0;count < 6 && it!=end; count ++)
+    ++it;
+
+// make sure we at valid position
+if(it==end)
+    --it;
+
+// print the text
+std::cout << std::string(start,it->iterator()) << std::endl;
+

That would print:

+
+ be or not to be, that
+
+ + + diff --git a/doc/html/building_boost_locale.html b/doc/html/building_boost_locale.html new file mode 100644 index 0000000..8363ce0 --- /dev/null +++ b/doc/html/building_boost_locale.html @@ -0,0 +1,228 @@ + + + + +Boost.Locale: Building The library + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Building The library

+
+
+

Boost.Locale presently supports CMake build system and Boost Build.

+
Note:
You need Boost 1.46 and above to use Boost.Build
+ +

+Building With Boost.Build

+

You need Boost 1.46 and above to use Boost.Build, it includes important patches that allow you to build the library correctly.

+

+Dependencies

+
    +
  • Boost 1.46 and above.
  • +
  • ICU library 3.6 or above is strongly recommended
  • +
  • If no ICU library is given, iconv support is required under POSIX platforms.
  • +
+

+Building Process

+

First of all we need to prepare our sources of Boost with Boost.Locale

+
    +
  • Download latest version of Boost and extract its sources
  • +
  • Download the latest version of Boost.Locale and extract its sources
  • +
  • Copy boost and libs subdirectory of Boost.Locale sources into the location of boost sources.
  • +
  • Bootstrap latest bjam version running bootstrap.sh or bootstrap.bat.
  • +
+

Now all you need to do is invoke bjam command:

+
+./bjam --with-locale stage
+

Or on Windows

+
+.\bjam --with-locale stage
+

If you are using custom ICU build or you are using Microsoft Windows you need to provide a path to location of ICU library using -sICU_PATH option

+

For example:

+
    +
  • If your icu build is placed at /opt/icu46 such that the files are placed like
    + /opt/icu46/include/unicode/uversion.h
    + /opt/icu46/include/unicode/calendar.h
    + ...
    + /opt/icu46/lib/libicudata.so
    + /opt/icu46/lib/libicui18n.so
    + ...
    + then you need to provide an option -sICU_PATH=/opt/icu46
    +    ./bjam --with-locale -sICU_PATH=/opt/icu46  stage
    +    
  • +
  • If your icu build is placed at c:\icu46 such that the files are placed like
    + c:\icu46\include\unicode\uversion.h
    + c:\icu46\include\unicode\calendar.h
    + ...
    + c:\icu46\bin\icudt.dll
    + c:\icu46\bin\icuin.dll
    + ...
    + c:\icu46\lib\icudt.lib
    + c:\icu46\lib\icuin.lib
    + ...
    + then you need to provide an option -sICU_PATH=c:\icu46
    +    .\bjam --with-locale -sICU_PATH=c:\icu46  stage
    +    
  • +
+
Note:
Don't forget to put both debug and release versions of ICU libraries in this path when using Microsoft Visual Studio so Boost.Build will link correctly debug and release versions of boost_locale library.
+

+Build Options

+

Boost.Locale supports following options with values off or on

+
    +
  • boost.locale.icu=off disable build of ICU backend even if ICU library exists
  • +
  • boost.locale.iconv=off or boost.locale.iconv=on enable or disable use of iconv library. It is off by default on Windows and Solaris
  • +
  • boost.locale.winapi=off - disable winapi backend, it is on by default on Windows and Cygwin
  • +
  • boost.locale.std=off or boost.locale.winapi=on Disable or enable std backends. std backend is disabled by default when using Sun Studio.
  • +
  • boost.locale.posix=on or boost.locale.posix=off Enable or disable support of POSIX backend, it is on by default on Linux and Mac OS X
  • +
+

Also Boost.Locale supports following options

+
    +
  • -sICU_PATH=/path/to/location/of/icu - the location of custom ICU library
  • +
  • -sICONV_PATH=/path/to/location/of/iconv - the location of custom iconv library
  • +
+

For example:

+
    +
  • Build the library on Windows with ICU backend only:
    +    .\bjam boost.locale.winapi=off boost.locale.std=off -sICU_PATH=c:\icu46 --with-locale stage
    +    
  • +
  • Build the library on Linux with std backend only
    +    .\bjam boost.locale.posix=off boost.locale.icu=off --with-locale stage
    +    
  • +
+

+Running Unit Tests

+

You can run unit tests by invoking bjam with libs/locale/test project parameter

+
+./bjam libs/locale/test
+

+Building With CMake

+
Note:
CMake build does not provide mangled library names like boost_locale-mt-gd.lib, so if you rely on auto-linking use Boost.Build.
+

+Dependencies

+
    +
  • CMake 2.6 and above.
  • +
  • Boost 1.35 and above.
  • +
  • Boost.Thread (when using ICU or when using Boost < 1.43)
  • +
  • ICU library 3.6 or above is strongly recommended
  • +
  • If no ICU library is given, iconv support is required under POSIX platforms.
  • +
+

+Building Process

+

The library build should be fairly simple for users familiar with CMake.

+
Note:
+
    +
  • MSVC Users: use nmake for building the library, MSVC projects are not supported!
  • +
  • Windows users: don't forget to set the PATH environment variable to point to ICU's dlls.
  • +
+

The simplest way to build the library is:

+
    +
  • Extract its sources
  • +
  • Go to the sources directory
  • +
  • Create a subdirectory named "build"
  • +
  • Go into this directory and run:
            cmake ..
    +        make
    +        make test
    +
    For windows you may need to specify:
            cmake -DCMAKE_INCLUDE_PATH=/path/to/icu/include:/path/to/boost/include -DCMAKE_LIBRARY_PATH=/path/to/icu/lib ..
    +
    And then:
            nmake
    +        nmake test
    +
    Or
            make && make test
    +
    Depending on your compiler.
  • +
+

+Build Options

+

This options can be passed to CMake to configure the library to your needs.

+
    +
  • DISABLE_SHARED - build only the static library
  • +
  • DISABLE_STATIC - build only the shared library
  • +
  • DISABLE_ICU - Disable the ICU backend (strongly discouraged)
  • +
  • DISABLE_STD_BACKED - Disable the "std" backend
  • +
  • DISABLE_POSIX_BACKEND - Disable the "posix" backend (ON by default on all but Linux and Mac OS X)
  • +
  • DISABLE_WINAPI_BACKEND - Disable the "winapi" backend (ON by default on POSIX platforms).
  • +
  • DISABLE_ICONV - Disable iconv-based conversion (ON by default on Windows)
  • +
+

Useful CMake options:

+
    +
  • CMAKE_INCLUDE_PATH - path to the boost library (if not system-wide)
  • +
  • CMAKE_INSTALL_PREFIX - installation path
  • +
  • CMAKE_BUILD_TYPE - default is Debug on Windows/MSVC and RelWithDebInfo on all other platforms.
  • +
+

Examples:

+
    +
  • Build Boost.Locale with only the "icu" backend on Linux
            cmake -DDISABLE_POSIX_BACKEND=ON -DDISABLE_STD_BACKEND=ON -DDISABLE_ICONV=ON ..
    +
  • +
  • Build Boost.Locale with the "winapi" and "std" backends on Windows
            cmake -G "NMake Makefiles" -DDISABLE_ICU_BACKEND=ON -DCMAKE_INCLUDE_PATH=c:/boost_1_43_0 ..
    +
  • +
+

+Binary Compatibility

+

Boost.Locale is built with binary compatibility in mind. Switching localization back ends on or off, or using iconv or not, does not affect binary compatibility. So if a dynamic library was built with all possible backends, other dynamic libraries compiled with, for example, only the std, posix or winapi backends would still be binary-compatible with it.

+

However this definitely has an effect on some features. For example, if you try to use boundary analysis or a calendar facet when the library does not support the icu backend you would get an exception.

+
+ + + diff --git a/doc/html/calendar_8cpp-example.html b/doc/html/calendar_8cpp-example.html new file mode 100644 index 0000000..ad4ffff --- /dev/null +++ b/doc/html/calendar_8cpp-example.html @@ -0,0 +1,144 @@ + + + + +Boost.Locale: calendar.cpp + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

calendar.cpp

+
+
+

Example of using date_time functions for generating calendar for current year.

+
//
+//  Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
+//
+//  Distributed under the Boost Software License, Version 1.0. (See
+//  accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+//
+#include <boost/locale.hpp>
+#include <iostream>
+#include <iomanip>
+#include <ctime>
+
+int main()
+{
+    using namespace boost::locale;
+
+    generator gen;
+    std::locale::global(gen(""));
+    std::cout.imbue(std::locale());
+    // Setup environment
+
+    boost::locale::date_time now;
+
+    date_time start=now;
+
+    // Set the first day of the first month of this year
+    start.set(period::month(),now.minimum(period::month()));
+    start.set(period::day(),start.minimum(period::day()));
+
+    int current_year = period::year(now);
+
+
+    // Display current year
+    std::cout << format("{1,ftime='%Y'}") % now << std::endl;
+
+    //
+    // Run forward untill current year is the date
+    //
+    for(now=start; period::year(now) == current_year;) {
+
+        // Print heading of month
+        if(calendar().is_gregorian()) 
+            std::cout << format("{1,ftime='%B'}") % now <<std::endl;
+        else
+            std::cout << format("{1,ftime='%B'} ({1,ftime='%Y-%m-%d',locale=en} - {2,locale=en,ftime='%Y-%m-%d'})")
+                % now 
+                % date_time(now,now.maximum(period::day())*period::day()) << std::endl;
+
+        int first = calendar().first_day_of_week();
+
+        // Print weeks days
+        for(int i=0;i<7;i++) {
+            date_time tmp(now,period::day_of_week() * (first + i));
+            std::cout << format("{1,w=8,ftime='%a'} ") % tmp;
+        }
+        std::cout << std::endl;
+
+        int current_month = now / period::month();
+        int skip = now / period::day_of_week_local() - 1;
+        for(int i=0;i<skip*9;i++)
+            std::cout << ' ';
+        for(;now / period::month() == current_month ;now += period::day()) {
+            std::cout << format("{1,w=8,ftime='%e'} ") % now;     
+            if(now / period::day_of_week_local() == 7)
+                std::cout << std::endl;
+        }
+        std::cout << std::endl;
+    }
+
+}
+// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
+
+ + + + diff --git a/doc/html/charset_handling.html b/doc/html/charset_handling.html new file mode 100644 index 0000000..c154a5d --- /dev/null +++ b/doc/html/charset_handling.html @@ -0,0 +1,161 @@ + + + + +Boost.Locale: Character Set Conversions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Character Set Conversions

+
+
+

+Convenience Interface

+

Boost.Locale provides to_utf, from_utf and utf_to_utf functions in the boost::locale::conv namespace. They are simple and convenient functions to convert a string to and from UTF-8/16/32 strings and strings using other encodings.

+

For example:

+
std::string utf8_string = to_utf<char>(latin1_string,"Latin1");
+std::wstring wide_string = to_utf<wchar_t>(latin1_string,"Latin1");
+std::string latin1_string = from_utf(wide_string,"Latin1");
+std::string utf8_string2 = utf_to_utf<char>(wide_string);
+

This function may use an explicit encoding name like "Latin1" or "ISO-8859-8", or use std::locale as a parameter to fetch this information from it. It also receives a policy parameter that tells it how to behave if the conversion can't be performed (i.e. an illegal or unsupported character is found). By default this function skips all illegal characters and tries to do the best it can, however, it is possible ask it to throw a conversion_error exception by passing the stop flag to it:

+
std::wstring s=to_utf<wchar_t>("\xFF\xFF","UTF-8",stop); 
+// Throws because this string is illegal in UTF-8
+

+std::codecvt facet

+

Boost.Locale provides stream codepage conversion facets based on the std::codecvt facet. This allows conversion between wide-character encodings and 8-bit encodings like UTF-8, ISO-8859 or Shift-JIS.

+

Most of compilers provide such facets, but:

+
    +
  • Under Windows MSVC does not support UTF-8 encodings at all.
  • +
  • Under Linux the encodings are supported only if the required locales are generated. For example it may be impossible to create a he_IL.CP1255 locale even when the he_IL locale is available.
  • +
+

Thus Boost.Locale provides an option to generate code-page conversion facets for use with Boost.Iostreams filters or std::wfstream. For example:

+
    std::locale loc= generator().generate("he_IL.UTF-8");
+    std::wofstream file.
+    file.imbue(loc);
+    file.open("hello.txt");
+    file << L"שלום!" << endl;
+

Would create a file hello.txt encoded as UTF-8 with "שלום!" (shalom) in it.

+

+Integration with Boost.Iostreams

+

You can use the std::codecvt facet directly, but this is quite tricky and requires accurate buffer and error management.

+

You can use the boost::iostreams::code_converter class for stream-oriented conversions between the wide-character set and narrow locale character set.

+

This is a sample program that converts wide to narrow characters for an arbitrary stream:

+
#include <boost/iostreams/stream.hpp>
+#include <boost/iostreams/categories.hpp> 
+#include <boost/iostreams/code_converter.hpp>
+
+#include <boost/locale.hpp>
+#include <iostream>
+
+namespace io = boost::iostreams;
+
+// Device that consumes the converted text,
+// In our case it just writes to standard output
+class consumer {
+public:
+    typedef char char_type;
+    typedef io::sink_tag category;
+    std::streamsize write(const char* s, std::streamsize n)
+    {
+        std::cout.write(s,n);
+        return n;
+    }
+};
+
+
+int main()
+{ 
+    // the device that converts wide characters
+    // to narrow
+    typedef io::code_converter<consumer> converter_device;
+    // the stream that uses this device
+    typedef io::stream<converter_device> converter_stream;
+
+
+    consumer cons;
+    // setup out converter to work
+    // with he_IL.UTF-8 locale 
+    converter_device dev;
+    boost::locale::generator gen;
+    dev.imbue(gen("he_IL.UTF-8"));
+    dev.open(cons);
+    converter_stream stream;
+    stream.open(dev);
+    // Now wide characters that are written
+    // to the stream would be given to
+    // our consumer as narrow characters 
+    // in UTF-8 encoding
+    stream << L"שלום" << std::flush;
+}
+

+Limitations of std::codecvt

+

The Standard does not provide any information about std::mbstate_t that could be used to save intermediate code-page conversion states. It leaves the definition up to the compiler implementation, making it impossible to reimplement std::codecvt<wchar_t,char,mbstate_t> for stateful encodings. Thus, Boost.Locale's codecvt facet implementation may be used with stateless encodings like UTF-8, ISO-8859, and Shift-JIS, but not with stateful encodings like UTF-7 or SCSU.

+

Recommendation: Prefer the Unicode UTF-8 encoding for char based strings and files in your application.

+
Note:
+

The implementation of codecvt for single byte encodings like ISO-8859-X and for UTF-8 is very efficent and would allow fast conversion of the content, however its performance may be sub-optimal for double-width encodings like Shift-JIS, due to the stateless problem described above.

+
+ + + diff --git a/doc/html/classboost_1_1locale_1_1abstract__calendar-members.html b/doc/html/classboost_1_1locale_1_1abstract__calendar-members.html new file mode 100644 index 0000000..ae7e34b --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1abstract__calendar-members.html @@ -0,0 +1,107 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::abstract_calendar Member List

+
+
+This is the complete list of members for boost::locale::abstract_calendar, including all inherited members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
absolute_maximum enum valueboost::locale::abstract_calendar
absolute_minimum enum valueboost::locale::abstract_calendar
actual_maximum enum valueboost::locale::abstract_calendar
actual_minimum enum valueboost::locale::abstract_calendar
adjust_value(period::marks::period_mark p, update_type u, int difference)=0boost::locale::abstract_calendar [pure virtual]
calendar_option_type enum nameboost::locale::abstract_calendar
clone() const =0boost::locale::abstract_calendar [pure virtual]
current enum valueboost::locale::abstract_calendar
difference(abstract_calendar const *other, period::marks::period_mark p) const =0boost::locale::abstract_calendar [pure virtual]
get_option(calendar_option_type opt) const =0boost::locale::abstract_calendar [pure virtual]
get_time() const =0boost::locale::abstract_calendar [pure virtual]
get_timezone() const =0boost::locale::abstract_calendar [pure virtual]
get_value(period::marks::period_mark p, value_type v) const =0boost::locale::abstract_calendar [pure virtual]
greatest_minimum enum valueboost::locale::abstract_calendar
is_dst enum valueboost::locale::abstract_calendar
is_gregorian enum valueboost::locale::abstract_calendar
least_maximum enum valueboost::locale::abstract_calendar
move enum valueboost::locale::abstract_calendar
normalize()=0boost::locale::abstract_calendar [pure virtual]
roll enum valueboost::locale::abstract_calendar
same(abstract_calendar const *other) const =0boost::locale::abstract_calendar [pure virtual]
set_option(calendar_option_type opt, int v)=0boost::locale::abstract_calendar [pure virtual]
set_time(posix_time const &p)=0boost::locale::abstract_calendar [pure virtual]
set_timezone(std::string const &tz)=0boost::locale::abstract_calendar [pure virtual]
set_value(period::marks::period_mark p, int value)=0boost::locale::abstract_calendar [pure virtual]
update_type enum nameboost::locale::abstract_calendar
value_type enum nameboost::locale::abstract_calendar
~abstract_calendar() (defined in boost::locale::abstract_calendar)boost::locale::abstract_calendar [inline, virtual]
+ + + diff --git a/doc/html/classboost_1_1locale_1_1abstract__calendar.html b/doc/html/classboost_1_1locale_1_1abstract__calendar.html new file mode 100644 index 0000000..d70e549 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1abstract__calendar.html @@ -0,0 +1,518 @@ + + + + +Boost.Locale: boost::locale::abstract_calendar Class Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::abstract_calendar Class Reference

+
+
+ +

#include <boost/locale/date_time_facet.hpp>

+ +

List of all members.

+ + + + + + + + + + + + + + + + + + + +

+Public Types

enum  value_type {
+  absolute_minimum, +actual_minimum, +greatest_minimum, +current, +
+  least_maximum, +actual_maximum, +absolute_maximum +
+ }
enum  update_type { move, +roll + }
enum  calendar_option_type { is_gregorian, +is_dst + }

+Public Member Functions

virtual abstract_calendarclone () const =0
virtual void set_value (period::marks::period_mark p, int value)=0
virtual void normalize ()=0
virtual int get_value (period::marks::period_mark p, value_type v) const =0
virtual void set_time (posix_time const &p)=0
virtual posix_time get_time () const =0
virtual void set_option (calendar_option_type opt, int v)=0
virtual int get_option (calendar_option_type opt) const =0
virtual void adjust_value (period::marks::period_mark p, update_type u, int difference)=0
virtual int difference (abstract_calendar const *other, period::marks::period_mark p) const =0
virtual void set_timezone (std::string const &tz)=0
virtual std::string get_timezone () const =0
virtual bool same (abstract_calendar const *other) const =0
+

Detailed Description

+

This class defines generic calendar class, it is used by date_time and calendar objects internally. It is less useful for end users, but it is build for localization backend implementation

+

Member Enumeration Documentation

+ +
+ +
+

Information about calendar

+
Enumerator:
+ + +
is_gregorian  +

Check if the calendar is Gregorian.

+
is_dst  +

Check if the current time is in daylight time savings.

+
+
+
+ +
+
+ +
+ +
+

A way to update the value

+
Enumerator:
+ + +
move  +

Change the value up or down effecting others for example 1990-12-31 + 1 day = 1991-01-01.

+
roll  +

Change the value up or down not effecting others for example 1990-12-31 + 1 day = 1990-12-01.

+
+
+
+ +
+
+ +
+ +
+

Type that defines how to fetch the value

+
Enumerator:
+ + + + + + + +
absolute_minimum  +

Absolute possible minimum for the value, for example for day is 1.

+
actual_minimum  +

Actual minimal value for this period.

+
greatest_minimum  +

Maximal minimum value that can be for this period.

+
current  +

Current value of this period.

+
least_maximum  +

The last maximal value for this period, For example for Gregorian calendar day it is 28

+
actual_maximum  +

Actual maximum, for it can be 28, 29, 30, 31 for day according to current month.

+
absolute_maximum  +

Maximal value, for Gregorian day it would be 31.

+
+
+
+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
virtual void boost::locale::abstract_calendar::adjust_value (period::marks::period_mark  p,
update_type  u,
int  difference 
) [pure virtual]
+
+
+

Adjust period's p value by difference items using a update_type u. Note: not all values are adjustable

+ +
+
+ +
+
+ + + + + + + + +
virtual abstract_calendar* boost::locale::abstract_calendar::clone ( )  const [pure virtual]
+
+
+

Make a polymorphic copy of the calendar

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
virtual int boost::locale::abstract_calendar::difference (abstract_calendar const *  other,
period::marks::period_mark  p 
) const [pure virtual]
+
+
+

Calculate the difference between this calendar and other in p units

+ +
+
+ +
+
+ + + + + + + + + +
virtual int boost::locale::abstract_calendar::get_option (calendar_option_type  opt )  const [pure virtual]
+
+
+

Get option for calendar, currently only check if it is Gregorian calendar

+ +
+
+ +
+
+ + + + + + + + +
virtual posix_time boost::locale::abstract_calendar::get_time ( )  const [pure virtual]
+
+
+

Get current time point

+ +
+
+ +
+
+ + + + + + + + +
virtual std::string boost::locale::abstract_calendar::get_timezone ( )  const [pure virtual]
+
+
+

Get current time zone, empty - system one

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
virtual int boost::locale::abstract_calendar::get_value (period::marks::period_mark  p,
value_type  v 
) const [pure virtual]
+
+
+

Get specific value for period p according to a value_type v

+ +
+
+ +
+
+ + + + + + + + +
virtual void boost::locale::abstract_calendar::normalize ( )  [pure virtual]
+
+
+

Recalculate all periods after setting them, should be called after use of set_value() function.

+ +
+
+ +
+
+ + + + + + + + + +
virtual bool boost::locale::abstract_calendar::same (abstract_calendar const *  other )  const [pure virtual]
+
+
+

Check of two calendars have same rules

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
virtual void boost::locale::abstract_calendar::set_option (calendar_option_type  opt,
int  v 
) [pure virtual]
+
+
+

Set option for calendar, for future use

+ +
+
+ +
+
+ + + + + + + + + +
virtual void boost::locale::abstract_calendar::set_time (posix_time const &  p )  [pure virtual]
+
+
+

Set current time point

+ +
+
+ +
+
+ + + + + + + + + +
virtual void boost::locale::abstract_calendar::set_timezone (std::string const &  tz )  [pure virtual]
+
+
+

Set time zone, empty - use system

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
virtual void boost::locale::abstract_calendar::set_value (period::marks::period_mark  p,
int  value 
) [pure virtual]
+
+
+

Set specific value for period p, note not all values are settable.

+

After call of set_value you may want to call normalize() function to make sure vall periods are updated, if you set sereral fields that are part of single date/time representation you should call set_value several times and then call normalize().

+

If normalize() is not called after set_value, the behavior is undefined

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1basic__format-members.html b/doc/html/classboost_1_1locale_1_1basic__format-members.html new file mode 100644 index 0000000..6da975a --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1basic__format-members.html @@ -0,0 +1,88 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::basic_format< CharType > Member List

+
+
+This is the complete list of members for boost::locale::basic_format< CharType >, including all inherited members. + + + + + + + + + +
basic_format(string_type format_string)boost::locale::basic_format< CharType > [inline]
basic_format(message_type const &trans)boost::locale::basic_format< CharType > [inline]
char_type typedefboost::locale::basic_format< CharType >
message_type typedefboost::locale::basic_format< CharType >
operator%(Formattible const &object)boost::locale::basic_format< CharType > [inline]
str(std::locale const &loc=std::locale()) const boost::locale::basic_format< CharType > [inline]
stream_type typedefboost::locale::basic_format< CharType >
string_type typedefboost::locale::basic_format< CharType >
write(stream_type &out) const boost::locale::basic_format< CharType > [inline]
+ + + diff --git a/doc/html/classboost_1_1locale_1_1basic__format.html b/doc/html/classboost_1_1locale_1_1basic__format.html new file mode 100644 index 0000000..aebf2b5 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1basic__format.html @@ -0,0 +1,323 @@ + + + + +Boost.Locale: boost::locale::basic_format< CharType > Class Template Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::basic_format< CharType > Class Template Reference
+ +[Format] +

+
+
+ +

a printf like class that allows type-safe and locale aware message formatting +More...

+ +

#include <boost/locale/format.hpp>

+ +

List of all members.

+ + + + + + + + + + + + + + + + + +

+Classes

class  format_guard

+Public Types

+typedef CharType char_type
 Underlying character type.
typedef basic_message< char_typemessage_type
typedef std::basic_string
+< CharType > 
string_type
+typedef std::basic_ostream
+< CharType > 
stream_type
 output stream type for this type of character

+Public Member Functions

 basic_format (string_type format_string)
 basic_format (message_type const &trans)
template<typename Formattible >
basic_formatoperator% (Formattible const &object)
string_type str (std::locale const &loc=std::locale()) const
void write (stream_type &out) const
+

Detailed Description

+

template<typename CharType>
+ class boost::locale::basic_format< CharType >

+ +

a printf like class that allows type-safe and locale aware message formatting

+

This class creates a formatted message similar to printf or boost::format and receives formatted entries via operator %.

+

For example

+
  cout << format("Hello {1}, you are {2} years old") % name % age << endl;
+

Formatting is enclosed between curly brackets { } and defined by a comma separated list of flags in the format key[=value] value may also be text included between single quotes ' that is used for special purposes where inclusion of non-ASCII text is allowed

+

Including of literal { and } is possible by specifying double brackets {{ and }} accordingly.

+

For example:

+
   cout << format("The height of water at {1,time} is {2,num=fixed,precision=3}") % time % height;
+

The special key -- a number without a value defines the position of an input parameter. List of keys:

+
    +
  • [0-9]+ -- digits, the index of a formatted parameter -- mandatory key.
  • +
  • num or number -- format a number. Optional values are:
      +
    • hex -- display hexadecimal number
    • +
    • oct -- display in octal format
    • +
    • sci or scientific -- display in scientific format
    • +
    • fix or fixed -- display in fixed format
    • +
    +For example number=sci
  • +
  • cur or currency -- format currency. Optional values are:
  • +
+
    +
  • iso -- display using ISO currency symbol.
  • +
  • nat or national -- display using national currency symbol.
  • +
+
    +
  • per or percent -- format percent value.
  • +
  • date, time , datetime or dt -- format date, time or date and time. Optional values are:
      +
    • s or short -- display in short format
    • +
    • m or medium -- display in medium format.
    • +
    • l or long -- display in long format.
    • +
    • f or full -- display in full format.
    • +
    +
  • +
  • ftime with string (quoted) parameter -- display as with strftime see, as::ftime manipulator
  • +
  • spell or spellout -- spell the number.
  • +
  • ord or ordinal -- format ordinal number (1st, 2nd... etc)
  • +
  • left or < -- align to left.
  • +
  • right or > -- align to right.
  • +
  • width or w -- set field width (requires parameter).
  • +
  • precision or p -- set precision (requires parameter).
  • +
  • locale -- with parameter -- switch locale for current operation. This command generates locale with formatting facets giving more fine grained control of formatting. For example:
        cout << format("Today {1,date} ({1,date,locale=he_IL.UTF-8@calendar=hebrew,date} Hebrew Date)") % date;
    +
  • +
  • timezone or tz -- the name of the timezone to display the time in. For example:
    +
        cout << format("Time is: Local {1,time}, ({1,time,tz=EET} Eastern European Time)") % date;
    +
  • +
  • local - display the time in local time
  • +
  • gmt - display the time in UTC time scale
        cout << format("Local time is: {1,time,local}, universal time is {1,time,gmt}") % time;
    +
  • +
+

Invalid formatting strings are slightly ignored. This would prevent from translator to crash the program in unexpected location.

+

Member Typedef Documentation

+ +
+
+
+template<typename CharType >
+ + + + +
typedef basic_message<char_type> boost::locale::basic_format< CharType >::message_type
+
+
+

The translation message type

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + +
typedef std::basic_string<CharType> boost::locale::basic_format< CharType >::string_type
+
+
+

string type for this type of character

+ +
+
+

Constructor & Destructor Documentation

+ +
+
+
+template<typename CharType >
+ + + + + + + + + +
boost::locale::basic_format< CharType >::basic_format (string_type  format_string )  [inline]
+
+
+

Create a format class for format_string

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + +
boost::locale::basic_format< CharType >::basic_format (message_type const &  trans )  [inline]
+
+
+

Create a format class using message trans. The message if translated first according to the rules of target locale and then interpreted as format string

+ +
+
+

Member Function Documentation

+ +
+
+
+template<typename CharType >
+
+template<typename Formattible >
+ + + + + + + + + +
basic_format& boost::locale::basic_format< CharType >::operator% (Formattible const &  object )  [inline]
+
+
+

Add new parameter to format list. The object should be a type with defined expression out << object where out is std::basic_ostream.

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + +
string_type boost::locale::basic_format< CharType >::str (std::locale const &  loc = std::locale() )  const [inline]
+
+
+

Format a string using a locale loc

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + +
void boost::locale::basic_format< CharType >::write (stream_type out )  const [inline]
+
+
+

write a formatted string to output stream out using out's locale

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1basic__message-members.html b/doc/html/classboost_1_1locale_1_1basic__message-members.html new file mode 100644 index 0000000..2f3cc0b --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1basic__message-members.html @@ -0,0 +1,101 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::basic_message< CharType > Member List

+
+
+This is the complete list of members for boost::locale::basic_message< CharType >, including all inherited members. + + + + + + + + + + + + + + + + + + + + + + +
basic_message()boost::locale::basic_message< CharType > [inline]
basic_message(char_type const *id)boost::locale::basic_message< CharType > [inline, explicit]
basic_message(char_type const *single, char_type const *plural, int n)boost::locale::basic_message< CharType > [inline, explicit]
basic_message(char_type const *context, char_type const *id)boost::locale::basic_message< CharType > [inline, explicit]
basic_message(char_type const *context, char_type const *single, char_type const *plural, int n)boost::locale::basic_message< CharType > [inline, explicit]
basic_message(string_type const &id)boost::locale::basic_message< CharType > [inline, explicit]
basic_message(string_type const &single, string_type const &plural, int number)boost::locale::basic_message< CharType > [inline, explicit]
basic_message(string_type const &context, string_type const &id)boost::locale::basic_message< CharType > [inline, explicit]
basic_message(string_type const &context, string_type const &single, string_type const &plural, int number)boost::locale::basic_message< CharType > [inline, explicit]
basic_message(basic_message const &other)boost::locale::basic_message< CharType > [inline]
char_type typedefboost::locale::basic_message< CharType >
facet_type typedefboost::locale::basic_message< CharType >
operator string_type() const boost::locale::basic_message< CharType > [inline]
operator=(basic_message const &other)boost::locale::basic_message< CharType > [inline]
str() const boost::locale::basic_message< CharType > [inline]
str(std::locale const &locale) const boost::locale::basic_message< CharType > [inline]
str(std::locale const &locale, std::string const &domain_id) const boost::locale::basic_message< CharType > [inline]
str(std::string const &domain_id) const boost::locale::basic_message< CharType > [inline]
str(std::locale const &loc, int id) const boost::locale::basic_message< CharType > [inline]
string_type typedefboost::locale::basic_message< CharType >
swap(basic_message &other)boost::locale::basic_message< CharType > [inline]
write(std::basic_ostream< char_type > &out) const boost::locale::basic_message< CharType > [inline]
+ + + diff --git a/doc/html/classboost_1_1locale_1_1basic__message.html b/doc/html/classboost_1_1locale_1_1basic__message.html new file mode 100644 index 0000000..8bad03f --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1basic__message.html @@ -0,0 +1,142 @@ + + + + +Boost.Locale: boost::locale::basic_message< CharType > Class Template Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::basic_message< CharType > Class Template Reference
+ +[Message Formatting (translation)] +

+
+
+ +

This class represents a message that can be converted to a specific locale message. +More...

+ +

#include <boost/locale/message.hpp>

+ +

List of all members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Types

+typedef CharType char_type
 The character this message object is used with.
+typedef std::basic_string
+< char_type
string_type
 The string type this object can be used with.
+typedef message_format< char_typefacet_type
 The type of the facet the messages are fetched with.

+Public Member Functions

 basic_message ()
 basic_message (char_type const *id)
 basic_message (char_type const *single, char_type const *plural, int n)
 basic_message (char_type const *context, char_type const *id)
 basic_message (char_type const *context, char_type const *single, char_type const *plural, int n)
 basic_message (string_type const &id)
 basic_message (string_type const &single, string_type const &plural, int number)
 basic_message (string_type const &context, string_type const &id)
 basic_message (string_type const &context, string_type const &single, string_type const &plural, int number)
 basic_message (basic_message const &other)
basic_message const & operator= (basic_message const &other)
void swap (basic_message &other)
 operator string_type () const
string_type str () const
string_type str (std::locale const &locale) const
string_type str (std::locale const &locale, std::string const &domain_id) const
string_type str (std::string const &domain_id) const
string_type str (std::locale const &loc, int id) const
void write (std::basic_ostream< char_type > &out) const
+

Detailed Description

+

template<typename CharType>
+ class boost::locale::basic_message< CharType >

+ +

This class represents a message that can be converted to a specific locale message.

+

It holds the original ASCII string that is queried in the dictionary when converting to the output string. The created string may be UTF-8, UTF-16, UTF-32 or other 8-bit encoded string according to the target character type and locale encoding.

+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1boundary_1_1boundary__indexing-members.html b/doc/html/classboost_1_1locale_1_1boundary_1_1boundary__indexing-members.html new file mode 100644 index 0000000..4e879a4 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1boundary_1_1boundary__indexing-members.html @@ -0,0 +1,82 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::boundary::boundary_indexing< Char > Member List

+
+
+This is the complete list of members for boost::locale::boundary::boundary_indexing< Char >, including all inherited members. + + + +
boundary_indexing(size_t refs=0)boost::locale::boundary::boundary_indexing< Char > [inline]
idboost::locale::boundary::boundary_indexing< Char > [static]
map(boundary_type t, Char const *begin, Char const *end) const =0boost::locale::boundary::boundary_indexing< Char > [pure virtual]
+ + + diff --git a/doc/html/classboost_1_1locale_1_1boundary_1_1boundary__indexing.html b/doc/html/classboost_1_1locale_1_1boundary_1_1boundary__indexing.html new file mode 100644 index 0000000..b8ca531 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1boundary_1_1boundary__indexing.html @@ -0,0 +1,194 @@ + + + + +Boost.Locale: boost::locale::boundary::boundary_indexing< Char > Class Template Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::boundary::boundary_indexing< Char > Class Template Reference
+ +[Boundary Analysis] +

+
+
+ +

This facet generates an index for boundary analysis for a given text. +More...

+ +

#include <boost/locale/boundary/facets.hpp>

+ +

List of all members.

+ + + + + + +

+Public Member Functions

 boundary_indexing (size_t refs=0)
virtual index_type map (boundary_type t, Char const *begin, Char const *end) const =0

+Static Public Attributes

static std::locale::id id
+

Detailed Description

+

template<typename Char>
+ class boost::locale::boundary::boundary_indexing< Char >

+ +

This facet generates an index for boundary analysis for a given text.

+

It is specialized for 4 types of characters char_t, wchar_t, char16_t and char32_t

+

Constructor & Destructor Documentation

+ +
+
+
+template<typename Char >
+ + + + + + + + + +
boost::locale::boundary::boundary_indexing< Char >::boundary_indexing (size_t  refs = 0 )  [inline]
+
+
+

Default constructor typical for facets

+ +
+
+

Member Function Documentation

+ +
+
+
+template<typename Char >
+ + + + + + + + + + + + + + + + + + + + + + + + +
virtual index_type boost::locale::boundary::boundary_indexing< Char >::map (boundary_type  t,
Char const *  begin,
Char const *  end 
) const [pure virtual]
+
+
+

Create index for boundary type t for text in range [begin,end)

+

The returned value is an index of type index_type. Note that this index is never empty, even if the range [begin,end) is empty it consists of at least one boundary point with the offset 0.

+ +
+
+

Member Data Documentation

+ +
+
+
+template<typename Char >
+ + + + +
std::locale::id boost::locale::boundary::boundary_indexing< Char >::id [static]
+
+
+

Identification of this facet

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1boundary_1_1boundary__point-members.html b/doc/html/classboost_1_1locale_1_1boundary_1_1boundary__point-members.html new file mode 100644 index 0000000..4d5f846 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1boundary_1_1boundary__point-members.html @@ -0,0 +1,91 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::boundary::boundary_point< IteratorType > Member List

+
+ + + + diff --git a/doc/html/classboost_1_1locale_1_1boundary_1_1boundary__point.html b/doc/html/classboost_1_1locale_1_1boundary_1_1boundary__point.html new file mode 100644 index 0000000..d017b1c --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1boundary_1_1boundary__point.html @@ -0,0 +1,394 @@ + + + + +Boost.Locale: boost::locale::boundary::boundary_point< IteratorType > Class Template Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::boundary::boundary_point< IteratorType > Class Template Reference
+ +[Boundary Analysis] +

+
+
+ +

This class represents a boundary point in the text. +More...

+ +

#include <boost/locale/boundary/boundary_point.hpp>

+ +

List of all members.

+ + + + + + + + + + + + + + + +

+Public Types

typedef IteratorType iterator_type

+Public Member Functions

 boundary_point ()
 boundary_point (iterator_type p, rule_type r)
void iterator (iterator_type i)
void rule (rule_type r)
iterator_type iterator () const
rule_type rule () const
bool operator== (boundary_point const &other) const
bool operator!= (boundary_point const &other) const
bool operator== (iterator_type const &other) const
bool operator!= (iterator_type const &other) const
 operator iterator_type () const
+

Detailed Description

+

template<typename IteratorType>
+ class boost::locale::boundary::boundary_point< IteratorType >

+ +

This class represents a boundary point in the text.

+

It represents a pair - an iterator and a rule that defines this point.

+

This type of object is dereference by the iterators of boundary_point_index. Using a rule() member function you can get the reason why this specific boundary point was selected.

+

For example, When you use a sentence boundary analysis, the (rule() & sentence_term) != 0 means that this boundary point was selected because a sentence terminator (like .?!) was spotted and the (rule() & sentence_sep)!=0 means that a separator like line feed or carriage return was observed.

+
Note:
+
    +
  • The beginning of analyzed range is always considered a boundary point and its rule is always 0.
  • +
  • when using a word boundary analysis the returned rule relates to a chunk of text preceding this point.
  • +
+
See also:
+ +

Member Typedef Documentation

+ +
+
+
+template<typename IteratorType>
+ + + + +
typedef IteratorType boost::locale::boundary::boundary_point< IteratorType >::iterator_type
+
+
+

The type of the base iterator that iterates the original text

+ +
+
+

Constructor & Destructor Documentation

+ +
+
+
+template<typename IteratorType>
+ + + + + + + + +
boost::locale::boundary::boundary_point< IteratorType >::boundary_point ( )  [inline]
+
+
+

Empty default constructor

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + + + + + + + + + + + + + + + +
boost::locale::boundary::boundary_point< IteratorType >::boundary_point (iterator_type  p,
rule_type  r 
) [inline]
+
+
+

Create a new boundary_point using iterator and a rule r

+ +
+
+

Member Function Documentation

+ +
+
+
+template<typename IteratorType>
+ + + + + + + + + +
void boost::locale::boundary::boundary_point< IteratorType >::iterator (iterator_type  i )  [inline]
+
+
+

Set an new iterator value i

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + + + + + +
iterator_type boost::locale::boundary::boundary_point< IteratorType >::iterator ( )  const [inline]
+
+
+

Fetch an iterator

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + + + + + +
boost::locale::boundary::boundary_point< IteratorType >::operator iterator_type ( )  const [inline]
+
+
+

Automatic cast to the iterator it represents

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + + + + + + +
bool boost::locale::boundary::boundary_point< IteratorType >::operator!= (iterator_type const &  other )  const [inline]
+
+
+

Check if the boundary point points to different location from an iterator other

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + + + + + + +
bool boost::locale::boundary::boundary_point< IteratorType >::operator!= (boundary_point< IteratorType > const &  other )  const [inline]
+
+
+

Check if two boundary points are different

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + + + + + + +
bool boost::locale::boundary::boundary_point< IteratorType >::operator== (iterator_type const &  other )  const [inline]
+
+
+

Check if the boundary point points to same location as an iterator other

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + + + + + + +
bool boost::locale::boundary::boundary_point< IteratorType >::operator== (boundary_point< IteratorType > const &  other )  const [inline]
+
+
+

Check if two boundary points are the same

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + + + + + +
rule_type boost::locale::boundary::boundary_point< IteratorType >::rule ( )  const [inline]
+
+
+

Fetch a rule

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + + + + + + +
void boost::locale::boundary::boundary_point< IteratorType >::rule (rule_type  r )  [inline]
+
+
+

Set an new rule value r

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1boundary_1_1boundary__point__index-members.html b/doc/html/classboost_1_1locale_1_1boundary_1_1boundary__point__index-members.html new file mode 100644 index 0000000..1a12ab8 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1boundary_1_1boundary__point__index-members.html @@ -0,0 +1,95 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::boundary::boundary_point_index< BaseIterator > Member List

+
+
+This is the complete list of members for boost::locale::boundary::boundary_point_index< BaseIterator >, including all inherited members. + + + + + + + + + + + + + + + + +
base_iterator typedefboost::locale::boundary::boundary_point_index< BaseIterator >
begin() const boost::locale::boundary::boundary_point_index< BaseIterator > [inline]
boundary_point_index()boost::locale::boundary::boundary_point_index< BaseIterator > [inline]
boundary_point_index(boundary_type type, base_iterator begin, base_iterator end, rule_type mask, std::locale const &loc=std::locale())boost::locale::boundary::boundary_point_index< BaseIterator > [inline]
boundary_point_index(boundary_type type, base_iterator begin, base_iterator end, std::locale const &loc=std::locale())boost::locale::boundary::boundary_point_index< BaseIterator > [inline]
boundary_point_index(segment_index< base_iterator > const &other)boost::locale::boundary::boundary_point_index< BaseIterator >
const_iterator typedefboost::locale::boundary::boundary_point_index< BaseIterator >
end() const boost::locale::boundary::boundary_point_index< BaseIterator > [inline]
find(base_iterator p) const boost::locale::boundary::boundary_point_index< BaseIterator > [inline]
iterator typedefboost::locale::boundary::boundary_point_index< BaseIterator >
map(boundary_type type, base_iterator begin, base_iterator end, std::locale const &loc=std::locale())boost::locale::boundary::boundary_point_index< BaseIterator > [inline]
operator=(segment_index< base_iterator > const &other)boost::locale::boundary::boundary_point_index< BaseIterator >
rule() const boost::locale::boundary::boundary_point_index< BaseIterator > [inline]
rule(rule_type v)boost::locale::boundary::boundary_point_index< BaseIterator > [inline]
segment_index< base_iterator > (defined in boost::locale::boundary::boundary_point_index< BaseIterator >)boost::locale::boundary::boundary_point_index< BaseIterator > [friend]
value_type typedefboost::locale::boundary::boundary_point_index< BaseIterator >
+ + + diff --git a/doc/html/classboost_1_1locale_1_1boundary_1_1boundary__point__index.html b/doc/html/classboost_1_1locale_1_1boundary_1_1boundary__point__index.html new file mode 100644 index 0000000..42c9b29 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1boundary_1_1boundary__point__index.html @@ -0,0 +1,181 @@ + + + + +Boost.Locale: boost::locale::boundary::boundary_point_index< BaseIterator > Class Template Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::boundary::boundary_point_index< BaseIterator > Class Template Reference
+ +[Boundary Analysis] +

+
+
+ +

This class holds an index of boundary points and allows iterating over them. +More...

+ +

#include <boost/locale/boundary/index.hpp>

+ +

List of all members.

+ + + + + + + + + + + + + + + + + + + + +

+Public Types

typedef BaseIterator base_iterator
typedef unspecified_iterator_type iterator
typedef unspecified_iterator_type const_iterator
typedef boundary_point
+< base_iterator
value_type

+Public Member Functions

 boundary_point_index ()
 boundary_point_index (boundary_type type, base_iterator begin, base_iterator end, rule_type mask, std::locale const &loc=std::locale())
 boundary_point_index (boundary_type type, base_iterator begin, base_iterator end, std::locale const &loc=std::locale())
 boundary_point_index (segment_index< base_iterator > const &other)
boundary_point_index const & operator= (segment_index< base_iterator > const &other)
void map (boundary_type type, base_iterator begin, base_iterator end, std::locale const &loc=std::locale())
iterator begin () const
iterator end () const
iterator find (base_iterator p) const
rule_type rule () const
void rule (rule_type v)

+Friends

+class segment_index< base_iterator >
+

Detailed Description

+

template<typename BaseIterator>
+ class boost::locale::boundary::boundary_point_index< BaseIterator >

+ +

This class holds an index of boundary points and allows iterating over them.

+

This class is provides begin() and end() member functions that return bidirectional iterators to the boundary_point objects.

+

It provides an option that affects selecting boundary points according to different rules: using rule(rule_type mask) member function. It allows to set a mask that select only specific types of boundary points like sentence_term.

+

For example for a sentence boundary analysis of a text "Hello! How\nare you?" when the default rule is used the boundary points would be:

+
    +
  • "|Hello! How\nare you?"
  • +
  • "Hello! |How\nare you?"
  • +
  • "Hello! How\n|are you?"
  • +
  • "Hello! How\nare you?|"
  • +
+

However if rule() is set to sentence_term then the selected boundary points would be:

+
    +
  • "|Hello! How\nare you?"
  • +
  • "Hello! |How\nare you?"
  • +
  • "Hello! How\nare you?|"
  • +
+

Such that a boundary point defined by a line feed character would be ignored.

+

This class allows to find a boundary_point according to the given iterator in range using find() member function.

+
Note:
    +
  • Even an empty text range [x,x) considered to have a one boundary point x.
  • +
  • a and b points of the range [a,b) are always considered boundary points regardless the rules used.
  • +
  • Changing any of the option rule() or course re-indexing the text invalidates existing iterators and they can't be used any more.
  • +
  • boundary_point_index can be created from segment_index or other boundary_point_index that was created with same boundary_type. This is very fast operation as they shared same index and it does not require its regeneration.
  • +
+
+
See also:
+ +

Member Typedef Documentation

+ +
+
+
+template<typename BaseIterator >
+ + + + +
typedef BaseIterator boost::locale::boundary::boundary_point_index< BaseIterator >::base_iterator
+
+
+

The type of the iterator used to iterate over the original text

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1boundary_1_1segment-members.html b/doc/html/classboost_1_1locale_1_1boundary_1_1segment-members.html new file mode 100644 index 0000000..1f77721 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1boundary_1_1segment-members.html @@ -0,0 +1,99 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::boundary::segment< IteratorType > Member List

+
+
+This is the complete list of members for boost::locale::boundary::segment< IteratorType >, including all inherited members. + + + + + + + + + + + + + + + + + + + + +
begin(iterator const &v)boost::locale::boundary::segment< IteratorType > [inline]
begin() const boost::locale::boundary::segment< IteratorType > [inline]
char_type typedefboost::locale::boundary::segment< IteratorType >
const_iterator typedefboost::locale::boundary::segment< IteratorType >
difference_type typedefboost::locale::boundary::segment< IteratorType >
empty() const boost::locale::boundary::segment< IteratorType > [inline]
end(iterator const &v)boost::locale::boundary::segment< IteratorType > [inline]
end() const boost::locale::boundary::segment< IteratorType > [inline]
iterator typedefboost::locale::boundary::segment< IteratorType >
length() const boost::locale::boundary::segment< IteratorType > [inline]
operator std::basic_string< char_type, T, A >() const boost::locale::boundary::segment< IteratorType > [inline]
operator!=(segment const &other)boost::locale::boundary::segment< IteratorType > [inline]
operator==(segment const &other)boost::locale::boundary::segment< IteratorType > [inline]
rule() const boost::locale::boundary::segment< IteratorType > [inline]
rule(rule_type r)boost::locale::boundary::segment< IteratorType > [inline]
segment()boost::locale::boundary::segment< IteratorType > [inline]
segment(iterator b, iterator e, rule_type r)boost::locale::boundary::segment< IteratorType > [inline]
str() const boost::locale::boundary::segment< IteratorType > [inline]
string_type typedefboost::locale::boundary::segment< IteratorType >
value_type typedefboost::locale::boundary::segment< IteratorType >
+ + + diff --git a/doc/html/classboost_1_1locale_1_1boundary_1_1segment.html b/doc/html/classboost_1_1locale_1_1boundary_1_1segment.html new file mode 100644 index 0000000..1788f37 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1boundary_1_1segment.html @@ -0,0 +1,510 @@ + + + + +Boost.Locale: boost::locale::boundary::segment< IteratorType > Class Template Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::boundary::segment< IteratorType > Class Template Reference
+ +[Boundary Analysis] +

+
+
+ +

a segment object that represents a pair of two iterators that define the range where this segment exits and a rule that defines it. +More...

+ +

#include <boost/locale/boundary/segment.hpp>

+ +

List of all members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Types

typedef std::iterator_traits
+< IteratorType >::value_type 
char_type
typedef std::basic_string
+< char_type
string_type
typedef char_type value_type
typedef IteratorType iterator
typedef IteratorType const_iterator
typedef std::iterator_traits
+< IteratorType >
+::difference_type 
difference_type

+Public Member Functions

 segment ()
 segment (iterator b, iterator e, rule_type r)
void begin (iterator const &v)
void end (iterator const &v)
IteratorType begin () const
IteratorType end () const
template<class T , class A >
 operator std::basic_string< char_type, T, A > () const
string_type str () const
size_t length () const
bool empty () const
rule_type rule () const
void rule (rule_type r)
+bool operator== (segment const &other)
 Compare two segments.
+bool operator!= (segment const &other)
 Compare two segments.
+

Detailed Description

+

template<typename IteratorType>
+ class boost::locale::boundary::segment< IteratorType >

+ +

a segment object that represents a pair of two iterators that define the range where this segment exits and a rule that defines it.

+

This type of object is dereferenced by the iterators of segment_index. Using a rule() member function you can get a specific rule this segment was selected with. For example, when you use word boundary analysis, you can check if the specific word contains Kana letters by checking (rule() & word_kana)!=0 For a sentence analysis you can check if the sentence is selected because a sentence terminator is found (sentence_term) or there is a line break (sentence_sep).

+

This object can be automatically converted to std::basic_string with the same type of character. It is also valid range that has begin() and end() member functions returning iterators on the location of the segment.

+
See also:
+ +

Member Typedef Documentation

+ +
+
+
+template<typename IteratorType>
+ + + + +
typedef std::iterator_traits<IteratorType>::value_type boost::locale::boundary::segment< IteratorType >::char_type
+
+
+

The type of the underlying character

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + +
typedef IteratorType boost::locale::boundary::segment< IteratorType >::const_iterator
+
+
+

The iterator that allows to iterate the range

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + +
typedef std::iterator_traits<IteratorType>::difference_type boost::locale::boundary::segment< IteratorType >::difference_type
+
+
+

The type that represent a difference between two iterators

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + +
typedef IteratorType boost::locale::boundary::segment< IteratorType >::iterator
+
+
+

The iterator that allows to iterate the range

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + +
typedef std::basic_string<char_type> boost::locale::boundary::segment< IteratorType >::string_type
+
+
+

The type of the string it is converted to

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + +
typedef char_type boost::locale::boundary::segment< IteratorType >::value_type
+
+
+

The value that iterators return - the character itself

+ +
+
+

Constructor & Destructor Documentation

+ +
+
+
+template<typename IteratorType>
+ + + + + + + + +
boost::locale::boundary::segment< IteratorType >::segment ( )  [inline]
+
+
+

Default constructor

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + + + + + + + + + + + + + + + + + + + + + +
boost::locale::boundary::segment< IteratorType >::segment (iterator  b,
iterator  e,
rule_type  r 
) [inline]
+
+
+

Create a segment using two iterators and a rule that represents this point

+ +
+
+

Member Function Documentation

+ +
+
+
+template<typename IteratorType>
+ + + + + + + + + +
void boost::locale::boundary::segment< IteratorType >::begin (iterator const &  v )  [inline]
+
+
+

Set the start of the range

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + + + + + +
IteratorType boost::locale::boundary::segment< IteratorType >::begin ( )  const [inline]
+
+
+

Get the start of the range

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + + + + + +
bool boost::locale::boundary::segment< IteratorType >::empty ( )  const [inline]
+
+
+

Check if the segment is empty

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + + + + + + +
void boost::locale::boundary::segment< IteratorType >::end (iterator const &  v )  [inline]
+
+
+

Set the end of the range

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + + + + + +
IteratorType boost::locale::boundary::segment< IteratorType >::end ( )  const [inline]
+
+
+

Set the end of the range

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + + + + + +
size_t boost::locale::boundary::segment< IteratorType >::length ( )  const [inline]
+
+
+

Get the length of the text chunk

+ +
+
+ +
+
+
+template<typename IteratorType>
+
+template<class T , class A >
+ + + + + + + + +
boost::locale::boundary::segment< IteratorType >::operator std::basic_string< char_type, T, A > ( )  const [inline]
+
+
+

Convert the range to a string automatically

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + + + + + +
rule_type boost::locale::boundary::segment< IteratorType >::rule ( )  const [inline]
+
+
+

Get the rule that is used for selection of this segment.

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + + + + + + +
void boost::locale::boundary::segment< IteratorType >::rule (rule_type  r )  [inline]
+
+
+

Set a rule that is used for segment selection

+ +
+
+ +
+
+
+template<typename IteratorType>
+ + + + + + + + +
string_type boost::locale::boundary::segment< IteratorType >::str ( )  const [inline]
+
+
+

Create a string from the range explicitly

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1boundary_1_1segment__index-members.html b/doc/html/classboost_1_1locale_1_1boundary_1_1segment__index-members.html new file mode 100644 index 0000000..8913314 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1boundary_1_1segment__index-members.html @@ -0,0 +1,97 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::boundary::segment_index< BaseIterator > Member List

+
+
+This is the complete list of members for boost::locale::boundary::segment_index< BaseIterator >, including all inherited members. + + + + + + + + + + + + + + + + + + +
base_iterator typedefboost::locale::boundary::segment_index< BaseIterator >
begin() const boost::locale::boundary::segment_index< BaseIterator > [inline]
boundary_point_index< base_iterator > (defined in boost::locale::boundary::segment_index< BaseIterator >)boost::locale::boundary::segment_index< BaseIterator > [friend]
const_iterator typedefboost::locale::boundary::segment_index< BaseIterator >
end() const boost::locale::boundary::segment_index< BaseIterator > [inline]
find(base_iterator p) const boost::locale::boundary::segment_index< BaseIterator > [inline]
full_select() const boost::locale::boundary::segment_index< BaseIterator > [inline]
full_select(bool v)boost::locale::boundary::segment_index< BaseIterator > [inline]
iterator typedefboost::locale::boundary::segment_index< BaseIterator >
map(boundary_type type, base_iterator begin, base_iterator end, std::locale const &loc=std::locale())boost::locale::boundary::segment_index< BaseIterator > [inline]
operator=(boundary_point_index< base_iterator > const &)boost::locale::boundary::segment_index< BaseIterator >
rule() const boost::locale::boundary::segment_index< BaseIterator > [inline]
rule(rule_type v)boost::locale::boundary::segment_index< BaseIterator > [inline]
segment_index()boost::locale::boundary::segment_index< BaseIterator > [inline]
segment_index(boundary_type type, base_iterator begin, base_iterator end, rule_type mask, std::locale const &loc=std::locale())boost::locale::boundary::segment_index< BaseIterator > [inline]
segment_index(boundary_type type, base_iterator begin, base_iterator end, std::locale const &loc=std::locale())boost::locale::boundary::segment_index< BaseIterator > [inline]
segment_index(boundary_point_index< base_iterator > const &)boost::locale::boundary::segment_index< BaseIterator >
value_type typedefboost::locale::boundary::segment_index< BaseIterator >
+ + + diff --git a/doc/html/classboost_1_1locale_1_1boundary_1_1segment__index.html b/doc/html/classboost_1_1locale_1_1boundary_1_1segment__index.html new file mode 100644 index 0000000..9d12dd2 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1boundary_1_1segment__index.html @@ -0,0 +1,183 @@ + + + + +Boost.Locale: boost::locale::boundary::segment_index< BaseIterator > Class Template Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::boundary::segment_index< BaseIterator > Class Template Reference
+ +[Boundary Analysis] +

+
+
+ +

This class holds an index of segments in the text range and allows to iterate over them. +More...

+ +

#include <boost/locale/boundary/index.hpp>

+ +

List of all members.

+ + + + + + + + + + + + + + + + + + + + + + +

+Public Types

typedef BaseIterator base_iterator
typedef unspecified_iterator_type iterator
typedef unspecified_iterator_type const_iterator
typedef segment< base_iteratorvalue_type

+Public Member Functions

 segment_index ()
 segment_index (boundary_type type, base_iterator begin, base_iterator end, rule_type mask, std::locale const &loc=std::locale())
 segment_index (boundary_type type, base_iterator begin, base_iterator end, std::locale const &loc=std::locale())
 segment_index (boundary_point_index< base_iterator > const &)
segment_index const & operator= (boundary_point_index< base_iterator > const &)
void map (boundary_type type, base_iterator begin, base_iterator end, std::locale const &loc=std::locale())
iterator begin () const
iterator end () const
iterator find (base_iterator p) const
rule_type rule () const
void rule (rule_type v)
bool full_select () const
void full_select (bool v)

+Friends

+class boundary_point_index< base_iterator >
+

Detailed Description

+

template<typename BaseIterator>
+ class boost::locale::boundary::segment_index< BaseIterator >

+ +

This class holds an index of segments in the text range and allows to iterate over them.

+

This class is provides begin() and end() member functions that return bidirectional iterators to the segment objects.

+

It provides two options on way of selecting segments:

+
    +
  • rule(rule_type mask) - a mask that allows to select only specific types of segments according to various masks as word_any.
    + The default is to select any types of boundaries.
    + For example: using word boundary analysis, when the provided mask is word_kana then the iterators would iterate only over the words containing Kana letters and word_any would select all types of words excluding ranges that consist of white space and punctuation marks. So iterating over the text "to be or not to be?" with word_any rule would return segments "to", "be", "or", "not", "to", "be", instead of default "to", " ", "be", " ", "or", " ", "not", " ", "to", " ", "be", "?".
  • +
  • full_select(bool how) - a flag that defines the way a range is selected if the rule of the previous boundary point does not fit the selected rule.
    + For example: We want to fetch all sentences from the following text: "Hello! How\nare you?".
    + This text contains three boundary points separating it to sentences by different rules:
      +
    • The exclamation mark "!" ends the sentence "Hello!"
    • +
    • The line feed that splits the sentence "How\nare you?" into two parts.
    • +
    • The question mark that ends the second sentence.
      + If you would only change the rule() to sentence_term then the segment_index would provide two sentences "Hello!" and "are you?" as only them actually terminated with required terminator "!" or "?". But changing full_select() to true, the selected segment would include all the text up to previous valid boundary point and would return two expected sentences: "Hello!" and "How\nare you?".
    • +
    +
  • +
+

This class allows to find a segment according to the given iterator in range using find() member function.

+
Note:
+ +
See also:
+ +
Examples:
+

boundary.cpp, and wboundary.cpp.

+
+

Member Typedef Documentation

+ +
+
+
+template<typename BaseIterator>
+ + + + +
typedef BaseIterator boost::locale::boundary::segment_index< BaseIterator >::base_iterator
+
+
+

The type of the iterator used to iterate over the original text

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1calendar-members.html b/doc/html/classboost_1_1locale_1_1calendar-members.html new file mode 100644 index 0000000..c531efe --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1calendar-members.html @@ -0,0 +1,98 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::calendar Member List

+
+
+This is the complete list of members for boost::locale::calendar, including all inherited members. + + + + + + + + + + + + + + + + + + + +
calendar(std::ios_base &ios)boost::locale::calendar
calendar(std::locale const &l, std::string const &zone)boost::locale::calendar
calendar(std::locale const &l)boost::locale::calendar
calendar(std::string const &zone)boost::locale::calendar
calendar()boost::locale::calendar
calendar(calendar const &other)boost::locale::calendar
date_time (defined in boost::locale::calendar)boost::locale::calendar [friend]
first_day_of_week() const boost::locale::calendar
get_locale() const boost::locale::calendar
get_time_zone() const boost::locale::calendar
greatest_minimum(period::period_type f) const boost::locale::calendar
is_gregorian() const boost::locale::calendar
least_maximum(period::period_type f) const boost::locale::calendar
maximum(period::period_type f) const boost::locale::calendar
minimum(period::period_type f) const boost::locale::calendar
operator!=(calendar const &other) const boost::locale::calendar
operator=(calendar const &other)boost::locale::calendar
operator==(calendar const &other) const boost::locale::calendar
~calendar() (defined in boost::locale::calendar)boost::locale::calendar
+ + + diff --git a/doc/html/classboost_1_1locale_1_1calendar.html b/doc/html/classboost_1_1locale_1_1calendar.html new file mode 100644 index 0000000..37a7642 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1calendar.html @@ -0,0 +1,466 @@ + + + + +Boost.Locale: boost::locale::calendar Class Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::calendar Class Reference
+ +[Date, Time, Timezone and Calendar manipulations] +

+
+
+ +

this class provides an access to general calendar information. +More...

+ +

#include <boost/locale/date_time.hpp>

+ +

List of all members.

+ + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 calendar (std::ios_base &ios)
 calendar (std::locale const &l, std::string const &zone)
 calendar (std::locale const &l)
 calendar (std::string const &zone)
 calendar ()
 calendar (calendar const &other)
calendar const & operator= (calendar const &other)
int minimum (period::period_type f) const
int greatest_minimum (period::period_type f) const
int maximum (period::period_type f) const
int least_maximum (period::period_type f) const
int first_day_of_week () const
std::locale get_locale () const
std::string get_time_zone () const
bool is_gregorian () const
bool operator== (calendar const &other) const
bool operator!= (calendar const &other) const

+Friends

+class date_time
+

Detailed Description

+

this class provides an access to general calendar information.

+

This information is not connected to specific date but generic to locale, and timezone. It is used in obtaining general information about calendar and is essential for creation of date_time objects.

+
Examples:
+

calendar.cpp.

+
+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + +
boost::locale::calendar::calendar (std::ios_base &  ios ) 
+
+
+

Create calendar taking locale and timezone information from ios_base instance.

+
Note:
throws std::bad_cast if ios does not have a locale with installed calendar_facet facet installed
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
boost::locale::calendar::calendar (std::locale const &  l,
std::string const &  zone 
)
+
+
+

Create calendar with locale l and time_zone zone

+
Note:
throws std::bad_cast if loc does not have calendar_facet facet installed
+ +
+
+ +
+
+ + + + + + + + + +
boost::locale::calendar::calendar (std::locale const &  l ) 
+
+
+

Create calendar with locale l and default timezone

+
Note:
throws std::bad_cast if loc does not have calendar_facet facet installed
+ +
+
+ +
+
+ + + + + + + + + +
boost::locale::calendar::calendar (std::string const &  zone ) 
+
+
+

Create calendar with default locale and timezone zone

+
Note:
throws std::bad_cast if global locale does not have calendar_facet facet installed
+ +
+
+ +
+
+ + + + + + + + +
boost::locale::calendar::calendar ( ) 
+
+
+

Create calendar with default locale and timezone

+
Note:
throws std::bad_cast if global locale does not have calendar_facet facet installed
+ +
+
+ +
+
+ + + + + + + + + +
boost::locale::calendar::calendar (calendar const &  other ) 
+
+
+

copy calendar

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + +
int boost::locale::calendar::first_day_of_week ( )  const
+
+
+

Get first day of week for specific calendar, for example for US it is 1 - Sunday for France it is 2 - Monday

+ +
+
+ +
+
+ + + + + + + + +
std::locale boost::locale::calendar::get_locale ( )  const
+
+
+

get calendar's locale

+ +
+
+ +
+
+ + + + + + + + +
std::string boost::locale::calendar::get_time_zone ( )  const
+
+
+

get calendar's time zone

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::calendar::greatest_minimum (period::period_type  f )  const
+
+
+

Get greatest possible minimum value for period f, For example for period::day it is 1, but may be different for other calendars.

+ +
+
+ +
+
+ + + + + + + + +
bool boost::locale::calendar::is_gregorian ( )  const
+
+
+

Check if the calendar is Gregorian

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::calendar::least_maximum (period::period_type  f )  const
+
+
+

Get least maximum value for period f, For example for Gregorian calendar's maximum period::day it is 28.

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::calendar::maximum (period::period_type  f )  const
+
+
+

Get maximum value for period f, For example for Gregorian calendar's maximum period::day it is 31.

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::calendar::minimum (period::period_type  f )  const
+
+
+

Get minimum value for period f, For example for period::day it is 1.

+ +
+
+ +
+
+ + + + + + + + + +
bool boost::locale::calendar::operator!= (calendar const &  other )  const
+
+
+

Opposite of ==

+ +
+
+ +
+
+ + + + + + + + + +
calendar const& boost::locale::calendar::operator= (calendar const &  other ) 
+
+
+

assign calendar

+ +
+
+ +
+
+ + + + + + + + + +
bool boost::locale::calendar::operator== (calendar const &  other )  const
+
+
+

Compare calendars for equivalence: i.e. calendar types, time zones etc.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1calendar__facet-members.html b/doc/html/classboost_1_1locale_1_1calendar__facet-members.html new file mode 100644 index 0000000..b4cc3d4 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1calendar__facet-members.html @@ -0,0 +1,82 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::calendar_facet Member List

+
+
+This is the complete list of members for boost::locale::calendar_facet, including all inherited members. + + + +
calendar_facet(size_t refs=0)boost::locale::calendar_facet [inline]
create_calendar() const =0boost::locale::calendar_facet [pure virtual]
idboost::locale::calendar_facet [static]
+ + + diff --git a/doc/html/classboost_1_1locale_1_1calendar__facet.html b/doc/html/classboost_1_1locale_1_1calendar__facet.html new file mode 100644 index 0000000..697f63d --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1calendar__facet.html @@ -0,0 +1,163 @@ + + + + +Boost.Locale: boost::locale::calendar_facet Class Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::calendar_facet Class Reference

+
+
+ +

the facet that generates calendar for specific locale +More...

+ +

#include <boost/locale/date_time_facet.hpp>

+ +

List of all members.

+ + + + + + +

+Public Member Functions

 calendar_facet (size_t refs=0)
virtual abstract_calendarcreate_calendar () const =0

+Static Public Attributes

static std::locale::id id
+

Detailed Description

+

the facet that generates calendar for specific locale

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + +
boost::locale::calendar_facet::calendar_facet (size_t  refs = 0 )  [inline]
+
+
+

Basic constructor

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + +
virtual abstract_calendar* boost::locale::calendar_facet::create_calendar ( )  const [pure virtual]
+
+
+

Create a new calendar that points to current point of time.

+ +
+
+

Member Data Documentation

+ +
+
+ + + + +
std::locale::id boost::locale::calendar_facet::id [static]
+
+
+

Locale id (needed to work with std::locale)

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1collator-members.html b/doc/html/classboost_1_1locale_1_1collator-members.html new file mode 100644 index 0000000..d74ae31 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1collator-members.html @@ -0,0 +1,101 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::collator< CharType > Member List

+
+
+This is the complete list of members for boost::locale::collator< CharType >, including all inherited members. + + + + + + + + + + + + + + + + + + + + + + +
char_type typedefboost::locale::collator< CharType >
collator(size_t refs=0)boost::locale::collator< CharType > [inline, protected]
compare(level_type level, char_type const *b1, char_type const *e1, char_type const *b2, char_type const *e2) const boost::locale::collator< CharType > [inline]
compare(level_type level, string_type const &l, string_type const &r) const boost::locale::collator< CharType > [inline]
do_compare(char_type const *b1, char_type const *e1, char_type const *b2, char_type const *e2) const boost::locale::collator< CharType > [inline, protected, virtual]
do_compare(level_type level, char_type const *b1, char_type const *e1, char_type const *b2, char_type const *e2) const =0boost::locale::collator< CharType > [protected, pure virtual]
do_hash(char_type const *b, char_type const *e) const boost::locale::collator< CharType > [inline, protected, virtual]
do_hash(level_type level, char_type const *b, char_type const *e) const =0boost::locale::collator< CharType > [protected, pure virtual]
do_transform(char_type const *b, char_type const *e) const boost::locale::collator< CharType > [inline, protected, virtual]
do_transform(level_type level, char_type const *b, char_type const *e) const =0boost::locale::collator< CharType > [protected, pure virtual]
hash(level_type level, char_type const *b, char_type const *e) const boost::locale::collator< CharType > [inline]
hash(level_type level, string_type const &s) const boost::locale::collator< CharType > [inline]
identical enum valueboost::locale::collator_base
level_type enum nameboost::locale::collator_base
primary enum valueboost::locale::collator_base
quaternary enum valueboost::locale::collator_base
secondary enum valueboost::locale::collator_base
string_type typedefboost::locale::collator< CharType >
tertiary enum valueboost::locale::collator_base
transform(level_type level, char_type const *b, char_type const *e) const boost::locale::collator< CharType > [inline]
transform(level_type level, string_type const &s) const boost::locale::collator< CharType > [inline]
~collator() (defined in boost::locale::collator< CharType >)boost::locale::collator< CharType > [inline, protected, virtual]
+ + + diff --git a/doc/html/classboost_1_1locale_1_1collator.html b/doc/html/classboost_1_1locale_1_1collator.html new file mode 100644 index 0000000..72a5e36 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1collator.html @@ -0,0 +1,645 @@ + + + + +Boost.Locale: boost::locale::collator< CharType > Class Template Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::collator< CharType > Class Template Reference
+ +[Collation] +

+
+
+ +

Collation facet. +More...

+ +

#include <boost/locale/collator.hpp>

+
+Inheritance diagram for boost::locale::collator< CharType >:
+
+
+ + +boost::locale::collator_base + +
+ +

List of all members.

+ + + + + + + + + + + + + + + + + + + +

+Public Types

typedef CharType char_type
typedef std::basic_string
+< CharType > 
string_type

+Public Member Functions

int compare (level_type level, char_type const *b1, char_type const *e1, char_type const *b2, char_type const *e2) const
string_type transform (level_type level, char_type const *b, char_type const *e) const
long hash (level_type level, char_type const *b, char_type const *e) const
int compare (level_type level, string_type const &l, string_type const &r) const
long hash (level_type level, string_type const &s) const
string_type transform (level_type level, string_type const &s) const

+Protected Member Functions

 collator (size_t refs=0)
virtual int do_compare (char_type const *b1, char_type const *e1, char_type const *b2, char_type const *e2) const
virtual string_type do_transform (char_type const *b, char_type const *e) const
virtual long do_hash (char_type const *b, char_type const *e) const
virtual int do_compare (level_type level, char_type const *b1, char_type const *e1, char_type const *b2, char_type const *e2) const =0
virtual string_type do_transform (level_type level, char_type const *b, char_type const *e) const =0
virtual long do_hash (level_type level, char_type const *b, char_type const *e) const =0
+

Detailed Description

+

template<typename CharType>
+ class boost::locale::collator< CharType >

+ +

Collation facet.

+

It reimplements standard C++ std::collate, allowing usage of std::locale for direct string comparison

+

Member Typedef Documentation

+ +
+
+
+template<typename CharType >
+ + + + +
typedef CharType boost::locale::collator< CharType >::char_type
+
+
+

Type of the underlying character

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + +
typedef std::basic_string<CharType> boost::locale::collator< CharType >::string_type
+
+
+

Type of string used with this facet

+ +
+
+

Constructor & Destructor Documentation

+ +
+
+
+template<typename CharType >
+ + + + + + + + + +
boost::locale::collator< CharType >::collator (size_t  refs = 0 )  [inline, protected]
+
+
+

constructor of the collator object

+ +
+
+

Member Function Documentation

+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int boost::locale::collator< CharType >::compare (level_type  level,
char_type const *  b1,
char_type const *  e1,
char_type const *  b2,
char_type const *  e2 
) const [inline]
+
+
+

Compare two strings in rage [b1,e1), [b2,e2) according using a collation level level. Calls do_compare

+

Returns -1 if the first of the two strings sorts before the seconds, returns 1 if sorts after and 0 if they considered equal.

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + +
int boost::locale::collator< CharType >::compare (level_type  level,
string_type const &  l,
string_type const &  r 
) const [inline]
+
+
+

Compare two strings l and r using collation level level

+

Returns -1 if the first of the two strings sorts before the seconds, returns 1 if sorts after and 0 if they considered equal.

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
virtual int boost::locale::collator< CharType >::do_compare (level_type  level,
char_type const *  b1,
char_type const *  e1,
char_type const *  b2,
char_type const *  e2 
) const [protected, pure virtual]
+
+
+

Actual function that performs comparison between the strings. For details see compare member function. Can be overridden.

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
virtual int boost::locale::collator< CharType >::do_compare (char_type const *  b1,
char_type const *  e1,
char_type const *  b2,
char_type const *  e2 
) const [inline, protected, virtual]
+
+
+

This function is used to override default collation function that does not take in account collation level. Uses primary level

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + +
virtual long boost::locale::collator< CharType >::do_hash (char_type const *  b,
char_type const *  e 
) const [inline, protected, virtual]
+
+
+

This function is used to override default collation function that does not take in account collation level. Uses primary level

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + +
virtual long boost::locale::collator< CharType >::do_hash (level_type  level,
char_type const *  b,
char_type const *  e 
) const [protected, pure virtual]
+
+
+

Actual function that calculates hash. For details see hash member function. Can be overridden.

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + +
virtual string_type boost::locale::collator< CharType >::do_transform (char_type const *  b,
char_type const *  e 
) const [inline, protected, virtual]
+
+
+

This function is used to override default collation function that does not take in account collation level. Uses primary level

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + +
virtual string_type boost::locale::collator< CharType >::do_transform (level_type  level,
char_type const *  b,
char_type const *  e 
) const [protected, pure virtual]
+
+
+

Actual function that performs transformation. For details see transform member function. Can be overridden.

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + +
long boost::locale::collator< CharType >::hash (level_type  level,
char_type const *  b,
char_type const *  e 
) const [inline]
+
+
+

Calculate a hash of a text in range [b,e). The value can be used for collation sensitive string comparison.

+

If compare(level,b1,e1,b2,e2) == 0 then hash(level,b1,e1) == hash(level,b2,e2)

+

Calls do_hash

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + +
long boost::locale::collator< CharType >::hash (level_type  level,
string_type const &  s 
) const [inline]
+
+
+

Calculate a hash that can be used for collation sensitive string comparison of a string s

+

If compare(level,s1,s2) == 0 then hash(level,s1) == hash(level,s2)

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + +
string_type boost::locale::collator< CharType >::transform (level_type  level,
string_type const &  s 
) const [inline]
+
+
+

Create a binary string from string s, that can be compared to other, useful for collation of multiple strings.

+

The transformation follows these rules:

+
   compare(level,s1,s2) == sign( transform(level,s1).compare(transform(level,s2)) );
+
+
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + +
string_type boost::locale::collator< CharType >::transform (level_type  level,
char_type const *  b,
char_type const *  e 
) const [inline]
+
+
+

Create a binary string that can be compared to other in order to get collation order. The string is created for text in range [b,e). It is useful for collation of multiple strings for text.

+

The transformation follows these rules:

+
   compare(level,b1,e1,b2,e2) == sign( transform(level,b1,e1).compare(transform(level,b2,e2)) );
+

Calls do_transform

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1collator.png b/doc/html/classboost_1_1locale_1_1collator.png new file mode 100644 index 0000000..7bc0322 Binary files /dev/null and b/doc/html/classboost_1_1locale_1_1collator.png differ diff --git a/doc/html/classboost_1_1locale_1_1collator__base-members.html b/doc/html/classboost_1_1locale_1_1collator__base-members.html new file mode 100644 index 0000000..18312ba --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1collator__base-members.html @@ -0,0 +1,85 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::collator_base Member List

+
+ + + + diff --git a/doc/html/classboost_1_1locale_1_1collator__base.html b/doc/html/classboost_1_1locale_1_1collator__base.html new file mode 100644 index 0000000..8757cfc --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1collator__base.html @@ -0,0 +1,158 @@ + + + + +Boost.Locale: boost::locale::collator_base Class Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::collator_base Class Reference
+ +[Collation] +

+
+
+ +

a base class that includes collation level flags +More...

+ +

#include <boost/locale/collator.hpp>

+
+Inheritance diagram for boost::locale::collator_base:
+
+
+ + +boost::locale::collator< CharType > + +
+ +

List of all members.

+ + + +

+Public Types

enum  level_type {
+  primary = 0, +secondary = 1, +tertiary = 2, +quaternary = 3, +
+  identical = 4 +
+ }
+

Detailed Description

+

a base class that includes collation level flags

+

Member Enumeration Documentation

+ +
+ +
+

Unicode collation level types

+
Enumerator:
+ + + + + +
primary  +

1st collation level: base letters

+
secondary  +

2nd collation level: letters and accents

+
tertiary  +

3rd collation level: letters, accents and case

+
quaternary  +

4th collation level: letters, accents, case and punctuation

+
identical  +

identical collation level: include code-point comparison

+
+
+
+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1collator__base.png b/doc/html/classboost_1_1locale_1_1collator__base.png new file mode 100644 index 0000000..4dd4aad Binary files /dev/null and b/doc/html/classboost_1_1locale_1_1collator__base.png differ diff --git a/doc/html/classboost_1_1locale_1_1conv_1_1conversion__error-members.html b/doc/html/classboost_1_1locale_1_1conv_1_1conversion__error-members.html new file mode 100644 index 0000000..ccdc134 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1conv_1_1conversion__error-members.html @@ -0,0 +1,80 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::conv::conversion_error Member List

+
+
+This is the complete list of members for boost::locale::conv::conversion_error, including all inherited members. + +
conversion_error() (defined in boost::locale::conv::conversion_error)boost::locale::conv::conversion_error [inline]
+ + + diff --git a/doc/html/classboost_1_1locale_1_1conv_1_1conversion__error.html b/doc/html/classboost_1_1locale_1_1conv_1_1conversion__error.html new file mode 100644 index 0000000..2767377 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1conv_1_1conversion__error.html @@ -0,0 +1,103 @@ + + + + +Boost.Locale: boost::locale::conv::conversion_error Class Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::conv::conversion_error Class Reference
+ +[Character conversion functions] +

+
+
+ +

The excepton that is thrown in case of conversion error. +More...

+ +

#include <boost/locale/encoding.hpp>

+ +

List of all members.

+ +
+

Detailed Description

+

The excepton that is thrown in case of conversion error.

+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1conv_1_1invalid__charset__error-members.html b/doc/html/classboost_1_1locale_1_1conv_1_1invalid__charset__error-members.html new file mode 100644 index 0000000..5f2f7e6 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1conv_1_1invalid__charset__error-members.html @@ -0,0 +1,80 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::conv::invalid_charset_error Member List

+
+
+This is the complete list of members for boost::locale::conv::invalid_charset_error, including all inherited members. + +
invalid_charset_error(std::string charset)boost::locale::conv::invalid_charset_error [inline]
+ + + diff --git a/doc/html/classboost_1_1locale_1_1conv_1_1invalid__charset__error.html b/doc/html/classboost_1_1locale_1_1conv_1_1invalid__charset__error.html new file mode 100644 index 0000000..bca739a --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1conv_1_1invalid__charset__error.html @@ -0,0 +1,110 @@ + + + + +Boost.Locale: boost::locale::conv::invalid_charset_error Class Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::conv::invalid_charset_error Class Reference
+ +[Character conversion functions] +

+
+
+ +

This exception is thrown in case of use of unsupported or invalid character set. +More...

+ +

#include <boost/locale/encoding.hpp>

+ +

List of all members.

+ + + + +

+Public Member Functions

invalid_charset_error (std::string charset)
 Create an error for charset charset.
+

Detailed Description

+

This exception is thrown in case of use of unsupported or invalid character set.

+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1converter-members.html b/doc/html/classboost_1_1locale_1_1converter-members.html new file mode 100644 index 0000000..cbfa1d3 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1converter-members.html @@ -0,0 +1,88 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::converter< Char > Member List

+
+
+This is the complete list of members for boost::locale::converter< Char >, including all inherited members. + + + + + + + + + +
case_folding enum valueboost::locale::converter_base
conversion_type enum nameboost::locale::converter_base
convert(conversion_type how, Char const *begin, Char const *end, int flags=0) const =0boost::locale::converter< Char > [pure virtual]
converter(size_t refs=0)boost::locale::converter< Char > [inline]
idboost::locale::converter< Char > [static]
lower_case enum valueboost::locale::converter_base
normalization enum valueboost::locale::converter_base
title_case enum valueboost::locale::converter_base
upper_case enum valueboost::locale::converter_base
+ + + diff --git a/doc/html/classboost_1_1locale_1_1converter.html b/doc/html/classboost_1_1locale_1_1converter.html new file mode 100644 index 0000000..b080b10 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1converter.html @@ -0,0 +1,172 @@ + + + + +Boost.Locale: boost::locale::converter< Char > Class Template Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::converter< Char > Class Template Reference
+ +[Text Conversions] +

+
+
+ +

The facet that implements text manipulation. +More...

+ +

#include <boost/locale/conversion.hpp>

+
+Inheritance diagram for boost::locale::converter< Char >:
+
+
+ + +boost::locale::converter_base + +
+ +

List of all members.

+ + + + + + + + +

+Public Member Functions

converter (size_t refs=0)
 Standard constructor.
virtual std::basic_string< Char > convert (conversion_type how, Char const *begin, Char const *end, int flags=0) const =0

+Static Public Attributes

+static std::locale::id id
 Locale identification.
+

Detailed Description

+

template<typename Char>
+ class boost::locale::converter< Char >

+ +

The facet that implements text manipulation.

+

It is used to performs text conversion operations defined by conversion_type. It is specialized for four types of characters char, wchar_t, char16_t, char32_t

+

Member Function Documentation

+ +
+
+
+template<typename Char >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
virtual std::basic_string<Char> boost::locale::converter< Char >::convert (conversion_type  how,
Char const *  begin,
Char const *  end,
int  flags = 0 
) const [pure virtual]
+
+
+

Convert text in range [begin, end) according to conversion method how. Parameter flags is used for specification of normalization method like nfd, nfc etc.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1converter.png b/doc/html/classboost_1_1locale_1_1converter.png new file mode 100644 index 0000000..a75543b Binary files /dev/null and b/doc/html/classboost_1_1locale_1_1converter.png differ diff --git a/doc/html/classboost_1_1locale_1_1converter__base-members.html b/doc/html/classboost_1_1locale_1_1converter__base-members.html new file mode 100644 index 0000000..f0aadc6 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1converter__base-members.html @@ -0,0 +1,85 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::converter_base Member List

+
+ + + + diff --git a/doc/html/classboost_1_1locale_1_1converter__base.html b/doc/html/classboost_1_1locale_1_1converter__base.html new file mode 100644 index 0000000..a8973cc --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1converter__base.html @@ -0,0 +1,158 @@ + + + + +Boost.Locale: boost::locale::converter_base Class Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::converter_base Class Reference
+ +[Text Conversions] +

+
+
+ +

This class provides base flags for text manipulation. It is used as base for converter facet. +More...

+ +

#include <boost/locale/conversion.hpp>

+
+Inheritance diagram for boost::locale::converter_base:
+
+
+ + +boost::locale::converter< Char > + +
+ +

List of all members.

+ + + +

+Public Types

enum  conversion_type {
+  normalization, +upper_case, +lower_case, +case_folding, +
+  title_case +
+ }
+

Detailed Description

+

This class provides base flags for text manipulation. It is used as base for converter facet.

+

Member Enumeration Documentation

+ +
+ +
+

The flag used for facet - the type of operation to perform

+
Enumerator:
+ + + + + +
normalization  +

Apply Unicode normalization on the text.

+
upper_case  +

Convert text to upper case.

+
lower_case  +

Convert text to lower case.

+
case_folding  +

Fold case in the text.

+
title_case  +

Convert text to title case.

+
+
+
+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1converter__base.png b/doc/html/classboost_1_1locale_1_1converter__base.png new file mode 100644 index 0000000..6026a51 Binary files /dev/null and b/doc/html/classboost_1_1locale_1_1converter__base.png differ diff --git a/doc/html/classboost_1_1locale_1_1date__time-members.html b/doc/html/classboost_1_1locale_1_1date__time-members.html new file mode 100644 index 0000000..32262ee --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1date__time-members.html @@ -0,0 +1,130 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::date_time Member List

+
+
+This is the complete list of members for boost::locale::date_time, including all inherited members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
date_time()boost::locale::date_time
date_time(date_time const &other)boost::locale::date_time
date_time(date_time const &other, date_time_period_set const &set)boost::locale::date_time
date_time(double time)boost::locale::date_time
date_time(double time, calendar const &cal)boost::locale::date_time
date_time(calendar const &cal)boost::locale::date_time
date_time(date_time_period_set const &set)boost::locale::date_time
date_time(date_time_period_set const &set, calendar const &cal)boost::locale::date_time
difference(date_time const &other, period::period_type f) const boost::locale::date_time
get(period::period_type f) const boost::locale::date_time
is_in_daylight_saving_time() const boost::locale::date_time
maximum(period::period_type f) const boost::locale::date_time
minimum(period::period_type f) const boost::locale::date_time
operator!=(date_time const &other) const boost::locale::date_time
operator+(period::period_type f) const boost::locale::date_time [inline]
operator+(date_time_period const &v) const boost::locale::date_time
operator+(date_time_period_set const &v) const boost::locale::date_time
operator+=(period::period_type f)boost::locale::date_time [inline]
operator+=(date_time_period const &v)boost::locale::date_time
operator+=(date_time_period_set const &v)boost::locale::date_time
operator-(period::period_type f) const boost::locale::date_time [inline]
operator-(date_time_period const &v) const boost::locale::date_time
operator-(date_time_period_set const &v) const boost::locale::date_time
operator-=(period::period_type f)boost::locale::date_time [inline]
operator-=(date_time_period const &v)boost::locale::date_time
operator-=(date_time_period_set const &v)boost::locale::date_time
operator/(period::period_type f) const boost::locale::date_time [inline]
operator<(date_time const &other) const boost::locale::date_time
operator<<(period::period_type f) const boost::locale::date_time [inline]
operator<<(date_time_period const &v) const boost::locale::date_time
operator<<(date_time_period_set const &v) const boost::locale::date_time
operator<<=(period::period_type f)boost::locale::date_time [inline]
operator<<=(date_time_period const &v)boost::locale::date_time
operator<<=(date_time_period_set const &v)boost::locale::date_time
operator<=(date_time const &other) const boost::locale::date_time
operator=(date_time const &other)boost::locale::date_time
operator=(date_time_period_set const &f)boost::locale::date_time
operator==(date_time const &other) const boost::locale::date_time
operator>(date_time const &other) const boost::locale::date_time
operator>=(date_time const &other) const boost::locale::date_time
operator>>(period::period_type f) const boost::locale::date_time [inline]
operator>>(date_time_period const &v) const boost::locale::date_time
operator>>(date_time_period_set const &v) const boost::locale::date_time
operator>>=(period::period_type f)boost::locale::date_time [inline]
operator>>=(date_time_period const &v)boost::locale::date_time
operator>>=(date_time_period_set const &v)boost::locale::date_time
set(period::period_type f, int v)boost::locale::date_time
swap(date_time &other)boost::locale::date_time
time() const boost::locale::date_time
time(double v)boost::locale::date_time
~date_time() (defined in boost::locale::date_time)boost::locale::date_time
+ + + diff --git a/doc/html/classboost_1_1locale_1_1date__time.html b/doc/html/classboost_1_1locale_1_1date__time.html new file mode 100644 index 0000000..5788e3d --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1date__time.html @@ -0,0 +1,1169 @@ + + + + +Boost.Locale: boost::locale::date_time Class Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::date_time Class Reference
+ +[Date, Time, Timezone and Calendar manipulations] +

+
+
+ +

this class represents a date time and allows to perform various operation according to the locale settings. +More...

+ +

#include <boost/locale/date_time.hpp>

+ +

List of all members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 date_time ()
 date_time (date_time const &other)
 date_time (date_time const &other, date_time_period_set const &set)
date_time const & operator= (date_time const &other)
 date_time (double time)
 date_time (double time, calendar const &cal)
 date_time (calendar const &cal)
 date_time (date_time_period_set const &set)
 date_time (date_time_period_set const &set, calendar const &cal)
date_time const & operator= (date_time_period_set const &f)
void set (period::period_type f, int v)
int get (period::period_type f) const
int operator/ (period::period_type f) const
date_time operator+ (period::period_type f) const
date_time operator- (period::period_type f) const
date_time const & operator+= (period::period_type f)
date_time const & operator-= (period::period_type f)
date_time operator<< (period::period_type f) const
date_time operator>> (period::period_type f) const
date_time const & operator<<= (period::period_type f)
date_time const & operator>>= (period::period_type f)
date_time operator+ (date_time_period const &v) const
date_time operator- (date_time_period const &v) const
date_time const & operator+= (date_time_period const &v)
date_time const & operator-= (date_time_period const &v)
date_time operator<< (date_time_period const &v) const
date_time operator>> (date_time_period const &v) const
date_time const & operator<<= (date_time_period const &v)
date_time const & operator>>= (date_time_period const &v)
date_time operator+ (date_time_period_set const &v) const
date_time operator- (date_time_period_set const &v) const
date_time const & operator+= (date_time_period_set const &v)
date_time const & operator-= (date_time_period_set const &v)
date_time operator<< (date_time_period_set const &v) const
date_time operator>> (date_time_period_set const &v) const
date_time const & operator<<= (date_time_period_set const &v)
date_time const & operator>>= (date_time_period_set const &v)
double time () const
void time (double v)
bool operator== (date_time const &other) const
bool operator!= (date_time const &other) const
bool operator< (date_time const &other) const
bool operator> (date_time const &other) const
bool operator<= (date_time const &other) const
bool operator>= (date_time const &other) const
void swap (date_time &other)
int difference (date_time const &other, period::period_type f) const
int minimum (period::period_type f) const
int maximum (period::period_type f) const
bool is_in_daylight_saving_time () const
+

Detailed Description

+

this class represents a date time and allows to perform various operation according to the locale settings.

+

This class allows to manipulate various aspects of dates and times easily using arithmetic operations with periods.

+

General arithmetic functions:

+ +

You can also assign specific periods using assignment operator like: some_time = year * 1995 that sets the year to 1995.

+
Examples:
+

calendar.cpp.

+
+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + +
boost::locale::date_time::date_time ( ) 
+
+
+

Dafault constructor, uses default calendar initialized date_time object to current time.

+
Note:
throws std::bad_cast if the global locale does not have calendar_facet facet installed
+ +
+
+ +
+
+ + + + + + + + + +
boost::locale::date_time::date_time (date_time const &  other ) 
+
+
+

copy date_time

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
boost::locale::date_time::date_time (date_time const &  other,
date_time_period_set const &  set 
)
+
+
+

copy date_time and change some fields according to the set

+ +
+
+ +
+
+ + + + + + + + + +
boost::locale::date_time::date_time (double  time ) 
+
+
+

Create a date_time object using POSIX time time and default calendar

+
Note:
throws std::bad_cast if the global locale does not have calendar_facet facet installed
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
boost::locale::date_time::date_time (double  time,
calendar const &  cal 
)
+
+
+

Create a date_time object using POSIX time time and calendar cal

+ +
+
+ +
+
+ + + + + + + + + +
boost::locale::date_time::date_time (calendar const &  cal ) 
+
+
+

Create a date_time object using calendar cal and initializes it to current time.

+ +
+
+ +
+
+ + + + + + + + + +
boost::locale::date_time::date_time (date_time_period_set const &  set ) 
+
+
+

Create a date_time object using default calendar and define values given in set

+
Note:
throws std::bad_cast if the global locale does not have calendar_facet facet installed
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
boost::locale::date_time::date_time (date_time_period_set const &  set,
calendar const &  cal 
)
+
+
+

Create a date_time object using calendar cal and define values given in set

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
int boost::locale::date_time::difference (date_time const &  other,
period::period_type  f 
) const
+
+
+

calculate the distance from this date_time to other in terms of perios f

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::date_time::get (period::period_type  f )  const
+
+
+

get specific period f value

+ +
+
+ +
+
+ + + + + + + + +
bool boost::locale::date_time::is_in_daylight_saving_time ( )  const
+
+
+

Check if *this time point is in daylight saving time

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::date_time::maximum (period::period_type  f )  const
+
+
+

Get minimal possible value for *this time point for a period f. For example in February maximum(day) may be 28 or 29, in January maximum(day)==31

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::date_time::minimum (period::period_type  f )  const
+
+
+

Get minimal possible value for *this time point for a period f.

+ +
+
+ +
+
+ + + + + + + + + +
bool boost::locale::date_time::operator!= (date_time const &  other )  const
+
+
+

compare date_time in the timeline (ignores difference in calendar, timezone etc)

+ +
+
+ +
+
+ + + + + + + + + +
date_time boost::locale::date_time::operator+ (date_time_period_set const &  v )  const
+
+
+

add date_time_period_set v to the current date_time

+ +
+
+ +
+
+ + + + + + + + + +
date_time boost::locale::date_time::operator+ (period::period_type  f )  const [inline]
+
+
+

add single period f to the current date_time

+ +
+
+ +
+
+ + + + + + + + + +
date_time boost::locale::date_time::operator+ (date_time_period const &  v )  const
+
+
+

add date_time_period to the current date_time

+ +
+
+ +
+
+ + + + + + + + + +
date_time const& boost::locale::date_time::operator+= (date_time_period const &  v ) 
+
+
+

add date_time_period to the current date_time

+ +
+
+ +
+
+ + + + + + + + + +
date_time const& boost::locale::date_time::operator+= (period::period_type  f )  [inline]
+
+
+

add single period f to the current date_time

+ +
+
+ +
+
+ + + + + + + + + +
date_time const& boost::locale::date_time::operator+= (date_time_period_set const &  v ) 
+
+
+

add date_time_period_set v to the current date_time

+ +
+
+ +
+
+ + + + + + + + + +
date_time boost::locale::date_time::operator- (date_time_period_set const &  v )  const
+
+
+

subtract date_time_period_set v from the current date_time

+ +
+
+ +
+
+ + + + + + + + + +
date_time boost::locale::date_time::operator- (period::period_type  f )  const [inline]
+
+
+

subtract single period f from the current date_time

+ +
+
+ +
+
+ + + + + + + + + +
date_time boost::locale::date_time::operator- (date_time_period const &  v )  const
+
+
+

subtract date_time_period from the current date_time

+ +
+
+ +
+
+ + + + + + + + + +
date_time const& boost::locale::date_time::operator-= (period::period_type  f )  [inline]
+
+
+

subtract single period f from the current date_time

+ +
+
+ +
+
+ + + + + + + + + +
date_time const& boost::locale::date_time::operator-= (date_time_period const &  v ) 
+
+
+

subtract date_time_period from the current date_time

+ +
+
+ +
+
+ + + + + + + + + +
date_time const& boost::locale::date_time::operator-= (date_time_period_set const &  v ) 
+
+
+

subtract date_time_period_set v from the current date_time

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::date_time::operator/ (period::period_type  f )  const [inline]
+
+
+

syntactic sugar for get(f)

+ +
+
+ +
+
+ + + + + + + + + +
bool boost::locale::date_time::operator< (date_time const &  other )  const
+
+
+

compare date_time in the timeline (ignores difference in calendar, timezone etc)

+ +
+
+ +
+
+ + + + + + + + + +
date_time boost::locale::date_time::operator<< (date_time_period const &  v )  const
+
+
+

roll current date_time forward by date_time_period v

+ +
+
+ +
+
+ + + + + + + + + +
date_time boost::locale::date_time::operator<< (period::period_type  f )  const [inline]
+
+
+

roll forward a date by single period f.

+ +
+
+ +
+
+ + + + + + + + + +
date_time boost::locale::date_time::operator<< (date_time_period_set const &  v )  const
+
+
+

roll current date_time forward by date_time_period_set v

+ +
+
+ +
+
+ + + + + + + + + +
date_time const& boost::locale::date_time::operator<<= (date_time_period const &  v ) 
+
+
+

roll current date_time forward by date_time_period v

+ +
+
+ +
+
+ + + + + + + + + +
date_time const& boost::locale::date_time::operator<<= (period::period_type  f )  [inline]
+
+
+

roll forward a date by single period f.

+ +
+
+ +
+
+ + + + + + + + + +
date_time const& boost::locale::date_time::operator<<= (date_time_period_set const &  v ) 
+
+
+

roll current date_time forward by date_time_period_set v

+ +
+
+ +
+
+ + + + + + + + + +
bool boost::locale::date_time::operator<= (date_time const &  other )  const
+
+
+

compare date_time in the timeline (ignores difference in calendar, timezone etc)

+ +
+
+ +
+
+ + + + + + + + + +
date_time const& boost::locale::date_time::operator= (date_time_period_set const &  f ) 
+
+
+

assign values to various periods in set f

+ +
+
+ +
+
+ + + + + + + + + +
date_time const& boost::locale::date_time::operator= (date_time const &  other ) 
+
+
+

assign the date_time

+ +
+
+ +
+
+ + + + + + + + + +
bool boost::locale::date_time::operator== (date_time const &  other )  const
+
+
+

compare date_time in the timeline (ignores difference in calendar, timezone etc)

+ +
+
+ +
+
+ + + + + + + + + +
bool boost::locale::date_time::operator> (date_time const &  other )  const
+
+
+

compare date_time in the timeline (ignores difference in calendar, timezone etc)

+ +
+
+ +
+
+ + + + + + + + + +
bool boost::locale::date_time::operator>= (date_time const &  other )  const
+
+
+

compare date_time in the timeline (ignores difference in calendar, timezone etc)

+ +
+
+ +
+
+ + + + + + + + + +
date_time boost::locale::date_time::operator>> (date_time_period const &  v )  const
+
+
+

roll current date_time backward by date_time_period v

+ +
+
+ +
+
+ + + + + + + + + +
date_time boost::locale::date_time::operator>> (period::period_type  f )  const [inline]
+
+
+

roll backward a date by single period f.

+ +
+
+ +
+
+ + + + + + + + + +
date_time boost::locale::date_time::operator>> (date_time_period_set const &  v )  const
+
+
+

roll current date_time backward by date_time_period_set v

+ +
+
+ +
+
+ + + + + + + + + +
date_time const& boost::locale::date_time::operator>>= (date_time_period_set const &  v ) 
+
+
+

roll current date_time backward by date_time_period_set v

+ +
+
+ +
+
+ + + + + + + + + +
date_time const& boost::locale::date_time::operator>>= (period::period_type  f )  [inline]
+
+
+

roll backward a date by single period f.

+ +
+
+ +
+
+ + + + + + + + + +
date_time const& boost::locale::date_time::operator>>= (date_time_period const &  v ) 
+
+
+

roll current date_time backward by date_time_period v

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
void boost::locale::date_time::set (period::period_type  f,
int  v 
)
+
+
+

set specific period f value to v

+ +
+
+ +
+
+ + + + + + + + + +
void boost::locale::date_time::swap (date_time other ) 
+
+
+

swaps two dates - efficient, does not throw

+ +
+
+ +
+
+ + + + + + + + +
double boost::locale::date_time::time ( )  const
+
+
+

Get POSIX time

+

The POSIX time is number of seconds since January 1st, 1970 00:00 UTC, ignoring leap seconds.

+ +
+
+ +
+
+ + + + + + + + + +
void boost::locale::date_time::time (double  v ) 
+
+
+

set POSIX time

+

The POSIX time is number of seconds since January 1st, 1970 00:00 UTC, ignoring leap seconds. This time can be fetched from Operating system clock using C function time, gettimeofday and others.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1date__time__duration-members.html b/doc/html/classboost_1_1locale_1_1date__time__duration-members.html new file mode 100644 index 0000000..a54e797 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1date__time__duration-members.html @@ -0,0 +1,84 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::date_time_duration Member List

+
+
+This is the complete list of members for boost::locale::date_time_duration, including all inherited members. + + + + + +
date_time_duration(date_time const &first, date_time const &second)boost::locale::date_time_duration [inline]
end() const boost::locale::date_time_duration [inline]
get(period::period_type f) const boost::locale::date_time_duration [inline]
operator/(period::period_type f) const boost::locale::date_time_duration [inline]
start() const boost::locale::date_time_duration [inline]
+ + + diff --git a/doc/html/classboost_1_1locale_1_1date__time__duration.html b/doc/html/classboost_1_1locale_1_1date__time__duration.html new file mode 100644 index 0000000..db91bea --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1date__time__duration.html @@ -0,0 +1,217 @@ + + + + +Boost.Locale: boost::locale::date_time_duration Class Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::date_time_duration Class Reference
+ +[Date, Time, Timezone and Calendar manipulations] +

+
+
+ +

This class represents a period: a pair of two date_time objects. +More...

+ +

#include <boost/locale/date_time.hpp>

+ +

List of all members.

+ + + + + + + +

+Public Member Functions

 date_time_duration (date_time const &first, date_time const &second)
int get (period::period_type f) const
int operator/ (period::period_type f) const
date_time const & start () const
date_time const & end () const
+

Detailed Description

+

This class represents a period: a pair of two date_time objects.

+

It is generally used as syntactic sugar to calculate difference between two dates.

+

Note: it stores references to the original objects, so it is not recommended to be used outside of the equation you calculate the difference in.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
boost::locale::date_time_duration::date_time_duration (date_time const &  first,
date_time const &  second 
) [inline]
+
+
+

Create an object were first represents earlier point on time line and second is later point.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + +
date_time const& boost::locale::date_time_duration::end ( )  const [inline]
+
+
+

Get ending point

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::date_time_duration::get (period::period_type  f )  const [inline]
+
+
+

find a difference in terms of period_type f

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::date_time_duration::operator/ (period::period_type  f )  const [inline]
+
+
+

Syntactic sugar for get(f)

+ +
+
+ +
+
+ + + + + + + + +
date_time const& boost::locale::date_time_duration::start ( )  const [inline]
+
+
+

Get starting point

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1date__time__error-members.html b/doc/html/classboost_1_1locale_1_1date__time__error-members.html new file mode 100644 index 0000000..19fbfd7 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1date__time__error-members.html @@ -0,0 +1,80 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::date_time_error Member List

+
+
+This is the complete list of members for boost::locale::date_time_error, including all inherited members. + +
date_time_error(std::string const &e)boost::locale::date_time_error [inline]
+ + + diff --git a/doc/html/classboost_1_1locale_1_1date__time__error.html b/doc/html/classboost_1_1locale_1_1date__time__error.html new file mode 100644 index 0000000..2e3ea16 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1date__time__error.html @@ -0,0 +1,127 @@ + + + + +Boost.Locale: boost::locale::date_time_error Class Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::date_time_error Class Reference
+ +[Date, Time, Timezone and Calendar manipulations] +

+
+
+ +

This error is thrown in case of invalid state that occurred. +More...

+ +

#include <boost/locale/date_time.hpp>

+ +

List of all members.

+ + + +

+Public Member Functions

 date_time_error (std::string const &e)
+

Detailed Description

+

This error is thrown in case of invalid state that occurred.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + +
boost::locale::date_time_error::date_time_error (std::string const &  e )  [inline]
+
+
+

Constructor of date_time_error class

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1date__time__period__set-members.html b/doc/html/classboost_1_1locale_1_1date__time__period__set-members.html new file mode 100644 index 0000000..80b10c9 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1date__time__period__set-members.html @@ -0,0 +1,85 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::date_time_period_set Member List

+
+
+This is the complete list of members for boost::locale::date_time_period_set, including all inherited members. + + + + + + +
add(date_time_period f)boost::locale::date_time_period_set [inline]
date_time_period_set()boost::locale::date_time_period_set [inline]
date_time_period_set(period::period_type f)boost::locale::date_time_period_set [inline]
date_time_period_set(date_time_period const &fl)boost::locale::date_time_period_set [inline]
operator[](size_t n) const boost::locale::date_time_period_set [inline]
size() const boost::locale::date_time_period_set [inline]
+ + + diff --git a/doc/html/classboost_1_1locale_1_1date__time__period__set.html b/doc/html/classboost_1_1locale_1_1date__time__period__set.html new file mode 100644 index 0000000..68b9ae5 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1date__time__period__set.html @@ -0,0 +1,227 @@ + + + + +Boost.Locale: boost::locale::date_time_period_set Class Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::date_time_period_set Class Reference
+ +[Date, Time, Timezone and Calendar manipulations] +

+
+
+ +

this class that represents a set of periods, +More...

+ +

#include <boost/locale/date_time.hpp>

+ +

List of all members.

+ + + + + + + + +

+Public Member Functions

 date_time_period_set ()
 date_time_period_set (period::period_type f)
 date_time_period_set (date_time_period const &fl)
void add (date_time_period f)
size_t size () const
date_time_period const & operator[] (size_t n) const
+

Detailed Description

+

this class that represents a set of periods,

+

It is generally created by operations on periods: 1995*year + 3*month + 1*day. Note: operations are not commutative.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + +
boost::locale::date_time_period_set::date_time_period_set ( )  [inline]
+
+
+

Default constructor - empty set

+ +
+
+ +
+
+ + + + + + + + + +
boost::locale::date_time_period_set::date_time_period_set (period::period_type  f )  [inline]
+
+
+

Create a set of single period with value 1

+ +
+
+ +
+
+ + + + + + + + + +
boost::locale::date_time_period_set::date_time_period_set (date_time_period const &  fl )  [inline]
+
+
+

Create a set of single period fl

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + + +
void boost::locale::date_time_period_set::add (date_time_period  f )  [inline]
+
+
+

Append date_time_period f to the set

+ +
+
+ +
+
+ + + + + + + + + +
date_time_period const& boost::locale::date_time_period_set::operator[] (size_t  n )  const [inline]
+
+
+

Get item at position n the set, n should be in range [0,size)

+ +
+
+ +
+
+ + + + + + + + +
size_t boost::locale::date_time_period_set::size ( )  const [inline]
+
+
+

Get number if items in list

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1generator-members.html b/doc/html/classboost_1_1locale_1_1generator-members.html new file mode 100644 index 0000000..6cd9691 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1generator-members.html @@ -0,0 +1,101 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::generator Member List

+
+ + + + diff --git a/doc/html/classboost_1_1locale_1_1generator.html b/doc/html/classboost_1_1locale_1_1generator.html new file mode 100644 index 0000000..d47f909 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1generator.html @@ -0,0 +1,550 @@ + + + + +Boost.Locale: boost::locale::generator Class Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::generator Class Reference

+
+
+ +

the major class used for locale generation +More...

+ +

#include <boost/locale/generator.hpp>

+ +

List of all members.

+ + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 generator ()
 generator (localization_backend_manager const &)
void categories (locale_category_type cats)
locale_category_type categories () const
void characters (character_facet_type chars)
character_facet_type characters () const
void add_messages_domain (std::string const &domain)
void set_default_messages_domain (std::string const &domain)
void clear_domains ()
void add_messages_path (std::string const &path)
void clear_paths ()
void clear_cache ()
void locale_cache_enabled (bool on)
bool locale_cache_enabled () const
bool use_ansi_encoding () const
void use_ansi_encoding (bool enc)
std::locale generate (std::string const &id) const
std::locale generate (std::locale const &base, std::string const &id) const
std::locale operator() (std::string const &id) const
void set_option (std::string const &name, std::string const &value)
void clear_options ()
+

Detailed Description

+

the major class used for locale generation

+

This class is used for specification of all parameters required for locale generation and caching. This class const member functions are thread safe if locale class implementation is thread safe.

+
Examples:
+

boundary.cpp, calendar.cpp, collate.cpp, conversions.cpp, hello.cpp, wboundary.cpp, wconversions.cpp, and whello.cpp.

+
+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + +
boost::locale::generator::generator ( ) 
+
+
+

Create new generator using global localization_backend_manager

+ +
+
+ +
+
+ + + + + + + + + +
boost::locale::generator::generator (localization_backend_manager const &  ) 
+
+
+

Create new generator using specific localization_backend_manager

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + + +
void boost::locale::generator::add_messages_domain (std::string const &  domain ) 
+
+
+

Add a new domain of messages that would be generated. It should be set in order to enable messages support.

+

Messages domain has following format: "name" or "name/encoding" where name is the base name of the "mo" file where the catalog is stored without ".mo" extension. For example for file /usr/share/locale/he/LC_MESSAGES/blog.mo it would be blog.

+

You can optionally specify the encoding of the keys in the sources by adding "/encoding_name" For example blog/cp1255.

+

If not defined all keys are assumed to be UTF-8 encoded.

+
Note:
When you select a domain for the program using dgettext or message API, you do not specify the encoding part. So for example if the provided domain name was "blog/windows-1255" then for translation you should use dgettext("blog","Hello")
+ +
+
+ +
+
+ + + + + + + + + +
void boost::locale::generator::add_messages_path (std::string const &  path ) 
+
+
+

Add a search path where dictionaries are looked in.

+
Note:
+
    +
  • Under the Windows platform the path is treated as a path in the locale's encoding so if you create locale "en_US.windows-1251" then path would be treated as cp1255, and if it is en_US.UTF-8 it is treated as UTF-8. File name is always opened with a wide file name as wide file names are the native file name on Windows.
  • +
+
    +
  • Under POSIX platforms all paths passed as-is regardless of encoding as narrow encodings are the native encodings for POSIX platforms.
  • +
+ +
+
+ +
+
+ + + + + + + + + +
void boost::locale::generator::categories (locale_category_type  cats ) 
+
+
+

Set types of facets that should be generated, default all

+ +
+
+ +
+
+ + + + + + + + +
locale_category_type boost::locale::generator::categories ( )  const
+
+
+

Get types of facets that should be generated, default all

+ +
+
+ +
+
+ + + + + + + + +
character_facet_type boost::locale::generator::characters ( )  const
+
+
+

Get the characters type for which the facets should be generated, default all supported

+ +
+
+ +
+
+ + + + + + + + + +
void boost::locale::generator::characters (character_facet_type  chars ) 
+
+
+

Set the characters type for which the facets should be generated, default all supported

+ +
+
+ +
+
+ + + + + + + + +
void boost::locale::generator::clear_cache ( ) 
+
+
+

Remove all cached locales

+ +
+
+ +
+
+ + + + + + + + +
void boost::locale::generator::clear_domains ( ) 
+
+
+

Remove all added domains from the list

+ +
+
+ +
+
+ + + + + + + + +
void boost::locale::generator::clear_options ( ) 
+
+
+

Clear backend specific options

+ +
+
+ +
+
+ + + + + + + + +
void boost::locale::generator::clear_paths ( ) 
+
+
+

Remove all added paths

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
std::locale boost::locale::generator::generate (std::locale const &  base,
std::string const &  id 
) const
+
+
+

Generate a locale with id id. Use base as a locale to which all facets are added, instead of std::locale::classic().

+ +
+
+ +
+
+ + + + + + + + + +
std::locale boost::locale::generator::generate (std::string const &  id )  const
+
+
+

Generate a locale with id id

+ +
+
+ +
+
+ + + + + + + + + +
void boost::locale::generator::locale_cache_enabled (bool  on ) 
+
+
+

Turn locale caching ON

+ +
+
+ +
+
+ + + + + + + + +
bool boost::locale::generator::locale_cache_enabled ( )  const
+
+
+

Get locale cache option

+ +
+
+ +
+
+ + + + + + + + + +
std::locale boost::locale::generator::operator() (std::string const &  id )  const [inline]
+
+
+

Shortcut to generate(id)

+ +
+
+ +
+
+ + + + + + + + + +
void boost::locale::generator::set_default_messages_domain (std::string const &  domain ) 
+
+
+

Set default message domain. If this member was not called, the first added messages domain is used. If the domain domain is not added yet it is added.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
void boost::locale::generator::set_option (std::string const &  name,
std::string const &  value 
)
+
+
+

Set backend specific option

+ +
+
+ +
+
+ + + + + + + + +
bool boost::locale::generator::use_ansi_encoding ( )  const
+
+
+

Check if by default ANSI encoding is selected or UTF-8 onces. The default is false.

+ +
+
+ +
+
+ + + + + + + + + +
void boost::locale::generator::use_ansi_encoding (bool  enc ) 
+
+
+

Select ANSI encodings as default system encoding rather then UTF-8 by default under Windows.

+

The default is the most portable and most powerful encoding, UTF-8, but the user can select "system" one if dealing with legacy applications

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1hold__ptr-members.html b/doc/html/classboost_1_1locale_1_1hold__ptr-members.html new file mode 100644 index 0000000..355564b --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1hold__ptr-members.html @@ -0,0 +1,91 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::hold_ptr< T > Member List

+
+ + + + diff --git a/doc/html/classboost_1_1locale_1_1hold__ptr.html b/doc/html/classboost_1_1locale_1_1hold__ptr.html new file mode 100644 index 0000000..b306b86 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1hold__ptr.html @@ -0,0 +1,344 @@ + + + + +Boost.Locale: boost::locale::hold_ptr< T > Class Template Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::hold_ptr< T > Class Template Reference

+
+
+ +

a smart pointer similar to std::auto_ptr but it is non-copyable and the underlying object has the same constness as the pointer itself (unlike an ordinary pointer). +More...

+ +

#include <boost/locale/hold_ptr.hpp>

+ +

List of all members.

+ + + + + + + + + + + + + + + +

+Public Member Functions

 hold_ptr ()
 hold_ptr (T *v)
 ~hold_ptr ()
T const * get () const
T * get ()
T const & operator* () const
T & operator* ()
T const * operator-> () const
T * operator-> ()
T * release ()
void reset (T *p=0)
+void swap (hold_ptr &other)
 Swap two pointers.
+

Detailed Description

+

template<typename T>
+ class boost::locale::hold_ptr< T >

+ +

a smart pointer similar to std::auto_ptr but it is non-copyable and the underlying object has the same constness as the pointer itself (unlike an ordinary pointer).

+

Constructor & Destructor Documentation

+ +
+
+
+template<typename T>
+ + + + + + + + +
boost::locale::hold_ptr< T >::hold_ptr ( )  [inline]
+
+
+

Create new empty pointer

+ +
+
+ +
+
+
+template<typename T>
+ + + + + + + + + +
boost::locale::hold_ptr< T >::hold_ptr (T *  v )  [inline, explicit]
+
+
+

Create a pointer that holds v, ownership is transferred to smart pointer

+ +
+
+ +
+
+
+template<typename T>
+ + + + + + + + +
boost::locale::hold_ptr< T >::~hold_ptr ( )  [inline]
+
+
+

Destroy smart pointer and the object it owns.

+ +
+
+

Member Function Documentation

+ +
+
+
+template<typename T>
+ + + + + + + + +
T const* boost::locale::hold_ptr< T >::get ( )  const [inline]
+
+
+

Get a const pointer to the object

+ +
+
+ +
+
+
+template<typename T>
+ + + + + + + + +
T* boost::locale::hold_ptr< T >::get ( )  [inline]
+
+
+

Get a mutable pointer to the object

+ +
+
+ +
+
+
+template<typename T>
+ + + + + + + + +
T& boost::locale::hold_ptr< T >::operator* ( )  [inline]
+
+
+

Get a mutable reference to the object

+ +
+
+ +
+
+
+template<typename T>
+ + + + + + + + +
T const& boost::locale::hold_ptr< T >::operator* ( )  const [inline]
+
+
+

Get a const reference to the object

+ +
+
+ +
+
+
+template<typename T>
+ + + + + + + + +
T const* boost::locale::hold_ptr< T >::operator-> ( )  const [inline]
+
+
+

Get a const pointer to the object

+ +
+
+ +
+
+
+template<typename T>
+ + + + + + + + +
T* boost::locale::hold_ptr< T >::operator-> ( )  [inline]
+
+
+

Get a mutable pointer to the object

+ +
+
+ +
+
+
+template<typename T>
+ + + + + + + + +
T* boost::locale::hold_ptr< T >::release ( )  [inline]
+
+
+

Transfer an ownership on the pointer to user

+ +
+
+ +
+
+
+template<typename T>
+ + + + + + + + + +
void boost::locale::hold_ptr< T >::reset (T *  p = 0 )  [inline]
+
+
+

Set new value to pointer, previous object is destroyed, ownership on new object is transferred

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1info-members.html b/doc/html/classboost_1_1locale_1_1info-members.html new file mode 100644 index 0000000..eb0bb41 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1info-members.html @@ -0,0 +1,97 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::info Member List

+
+
+This is the complete list of members for boost::locale::info, including all inherited members. + + + + + + + + + + + + + + + + + + +
country() const boost::locale::info [inline]
country_property enum valueboost::locale::info
encoding() const boost::locale::info [inline]
encoding_property enum valueboost::locale::info
get_integer_property(integer_property v) const =0boost::locale::info [protected, pure virtual]
get_string_property(string_propery v) const =0boost::locale::info [protected, pure virtual]
idboost::locale::info [static]
info(size_t refs=0)boost::locale::info [inline]
integer_property enum nameboost::locale::info
language() const boost::locale::info [inline]
language_property enum valueboost::locale::info
name() const boost::locale::info [inline]
name_property enum valueboost::locale::info
string_propery enum nameboost::locale::info
utf8() const boost::locale::info [inline]
utf8_property enum valueboost::locale::info
variant() const boost::locale::info [inline]
variant_property enum valueboost::locale::info
+ + + diff --git a/doc/html/classboost_1_1locale_1_1info.html b/doc/html/classboost_1_1locale_1_1info.html new file mode 100644 index 0000000..b29355a --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1info.html @@ -0,0 +1,358 @@ + + + + +Boost.Locale: boost::locale::info Class Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::info Class Reference

+
+
+ +

a facet that holds general information about locale +More...

+ +

#include <boost/locale/info.hpp>

+ +

List of all members.

+ + + + + + + + + + + + + + + + + + +

+Public Types

enum  string_propery {
+  language_property, +country_property, +variant_property, +encoding_property, +
+  name_property +
+ }
enum  integer_property { utf8_property + }

+Public Member Functions

 info (size_t refs=0)
std::string language () const
std::string country () const
std::string variant () const
std::string encoding () const
std::string name () const
bool utf8 () const

+Static Public Attributes

+static std::locale::id id
 This member uniquely defines this facet, required by STL.

+Protected Member Functions

virtual std::string get_string_property (string_propery v) const =0
virtual int get_integer_property (integer_property v) const =0
+

Detailed Description

+

a facet that holds general information about locale

+

This facet should be always created in order to make all Boost.Locale functions work

+

Member Enumeration Documentation

+ +
+ +
+

Integer information about locale

+
Enumerator:
+ +
utf8_property  +

Non zero value if uses UTF-8 encoding.

+
+
+
+ +
+
+ +
+ +
+

String information about the locale

+
Enumerator:
+ + + + + +
language_property  +

ISO 639 language id.

+
country_property  +

ISO 3166 country id.

+
variant_property  +

Variant for locale.

+
encoding_property  +

encoding name

+
name_property  +

locale name

+
+
+
+ +
+
+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + +
boost::locale::info::info (size_t  refs = 0 )  [inline]
+
+
+

Standard facet's constructor

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + +
std::string boost::locale::info::country ( )  const [inline]
+
+
+

Get country name

+ +
+
+ +
+
+ + + + + + + + +
std::string boost::locale::info::encoding ( )  const [inline]
+
+
+

Get encoding

+ +
+
+ +
+
+ + + + + + + + + +
virtual int boost::locale::info::get_integer_property (integer_property  v )  const [protected, pure virtual]
+
+
+

Get integer property by its id v

+ +
+
+ +
+
+ + + + + + + + + +
virtual std::string boost::locale::info::get_string_property (string_propery  v )  const [protected, pure virtual]
+
+
+

Get string property by its id v

+ +
+
+ +
+
+ + + + + + + + +
std::string boost::locale::info::language ( )  const [inline]
+
+
+

Get language name

+ +
+
+ +
+
+ + + + + + + + +
std::string boost::locale::info::name ( )  const [inline]
+
+
+

Get the name of the locale, like en_US.UTF-8

+ +
+
+ +
+
+ + + + + + + + +
bool boost::locale::info::utf8 ( )  const [inline]
+
+
+

True if the underlying encoding is UTF-8 (for char streams and strings)

+ +
+
+ +
+
+ + + + + + + + +
std::string boost::locale::info::variant ( )  const [inline]
+
+
+

Get locale variant

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1ios__info-members.html b/doc/html/classboost_1_1locale_1_1ios__info-members.html new file mode 100644 index 0000000..aec78be --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1ios__info-members.html @@ -0,0 +1,96 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::ios_info Member List

+
+ + + + diff --git a/doc/html/classboost_1_1locale_1_1ios__info.html b/doc/html/classboost_1_1locale_1_1ios__info.html new file mode 100644 index 0000000..b707613 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1ios__info.html @@ -0,0 +1,450 @@ + + + + +Boost.Locale: boost::locale::ios_info Class Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::ios_info Class Reference

+
+
+ +

This class holds an external data - beyond existing fmtflags that std::ios_base holds. +More...

+ +

#include <boost/locale/formatting.hpp>

+ +

List of all members.

+ + + + + + + + + + + + + + + + + + + + + + + + +

+Classes

class  string_set

+Public Member Functions

void display_flags (uint64_t flags)
void currency_flags (uint64_t flags)
void date_flags (uint64_t flags)
void time_flags (uint64_t flags)
void datetime_flags (uint64_t flags)
void domain_id (int)
void time_zone (std::string const &)
template<typename CharType >
void date_time_pattern (std::basic_string< CharType > const &str)
uint64_t display_flags () const
uint64_t currency_flags () const
uint64_t date_flags () const
uint64_t time_flags () const
uint64_t datetime_flags () const
int domain_id () const
std::string time_zone () const
template<typename CharType >
std::basic_string< CharType > date_time_pattern () const

+Static Public Member Functions

static ios_infoget (std::ios_base &ios)
+

Detailed Description

+

This class holds an external data - beyond existing fmtflags that std::ios_base holds.

+

You should almost never create this object directly. Instead, you should access it via ios_info::get(stream_object) static member function. It automatically creates default formatting data for that stream

+

Member Function Documentation

+ +
+
+ + + + + + + + + +
void boost::locale::ios_info::currency_flags (uint64_t  flags ) 
+
+
+

Set a flags that define how to format currency

+ +
+
+ +
+
+ + + + + + + + +
uint64_t boost::locale::ios_info::currency_flags ( )  const
+
+
+

Get a flags that define how to format currency

+ +
+
+ +
+
+ + + + + + + + + +
void boost::locale::ios_info::date_flags (uint64_t  flags ) 
+
+
+

Set a flags that define how to format date

+ +
+
+ +
+
+ + + + + + + + +
uint64_t boost::locale::ios_info::date_flags ( )  const
+
+
+

Get a flags that define how to format date

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + +
void boost::locale::ios_info::date_time_pattern (std::basic_string< CharType > const &  str )  [inline]
+
+
+

Set date/time pattern (strftime like)

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + +
std::basic_string<CharType> boost::locale::ios_info::date_time_pattern ( )  const [inline]
+
+
+

Get date/time pattern (strftime like)

+ +
+
+ +
+
+ + + + + + + + + +
void boost::locale::ios_info::datetime_flags (uint64_t  flags ) 
+
+
+

Set a flags that define how to format both date and time

+ +
+
+ +
+
+ + + + + + + + +
uint64_t boost::locale::ios_info::datetime_flags ( )  const
+
+
+

Get a flags that define how to format both date and time

+ +
+
+ +
+
+ + + + + + + + +
uint64_t boost::locale::ios_info::display_flags ( )  const
+
+
+

Get a flags that define a way for format data like number, spell, currency etc.

+ +
+
+ +
+
+ + + + + + + + + +
void boost::locale::ios_info::display_flags (uint64_t  flags ) 
+
+
+

Set a flags that define a way for format data like number, spell, currency etc.

+ +
+
+ +
+
+ + + + + + + + + +
void boost::locale::ios_info::domain_id (int  ) 
+
+
+

Set special message domain identification

+ +
+
+ +
+
+ + + + + + + + +
int boost::locale::ios_info::domain_id ( )  const
+
+
+

Get special message domain identification

+ +
+
+ +
+
+ + + + + + + + + +
static ios_info& boost::locale::ios_info::get (std::ios_base &  ios )  [static]
+
+
+

Get ios_info instance for specific stream object

+ +
+
+ +
+
+ + + + + + + + +
uint64_t boost::locale::ios_info::time_flags ( )  const
+
+
+

Get a flags that define how to format time

+ +
+
+ +
+
+ + + + + + + + + +
void boost::locale::ios_info::time_flags (uint64_t  flags ) 
+
+
+

Set a flags that define how to format time

+ +
+
+ +
+
+ + + + + + + + +
std::string boost::locale::ios_info::time_zone ( )  const
+
+
+

Get time zone for formatting dates and time

+ +
+
+ +
+
+ + + + + + + + + +
void boost::locale::ios_info::time_zone (std::string const &  ) 
+
+
+

Set time zone for formatting dates and time

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1localization__backend-members.html b/doc/html/classboost_1_1locale_1_1localization__backend-members.html new file mode 100644 index 0000000..c4862bb --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1localization__backend-members.html @@ -0,0 +1,85 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::localization_backend Member List

+
+
+This is the complete list of members for boost::locale::localization_backend, including all inherited members. + + + + + + +
clear_options()=0boost::locale::localization_backend [pure virtual]
clone() const =0boost::locale::localization_backend [pure virtual]
install(std::locale const &base, locale_category_type category, character_facet_type type=nochar_facet)=0boost::locale::localization_backend [pure virtual]
localization_backend() (defined in boost::locale::localization_backend)boost::locale::localization_backend [inline]
set_option(std::string const &name, std::string const &value)=0boost::locale::localization_backend [pure virtual]
~localization_backend() (defined in boost::locale::localization_backend)boost::locale::localization_backend [inline, virtual]
+ + + diff --git a/doc/html/classboost_1_1locale_1_1localization__backend.html b/doc/html/classboost_1_1locale_1_1localization__backend.html new file mode 100644 index 0000000..e9af3b6 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1localization__backend.html @@ -0,0 +1,215 @@ + + + + +Boost.Locale: boost::locale::localization_backend Class Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::localization_backend Class Reference

+
+
+ +

this class represents a localization backend that can be used for localizing your application. +More...

+ +

#include <boost/locale/localization_backend.hpp>

+ +

List of all members.

+ + + + + + +

+Public Member Functions

virtual localization_backendclone () const =0
virtual void set_option (std::string const &name, std::string const &value)=0
virtual void clear_options ()=0
virtual std::locale install (std::locale const &base, locale_category_type category, character_facet_type type=nochar_facet)=0
+

Detailed Description

+

this class represents a localization backend that can be used for localizing your application.

+

Backends are usually registered inside the localization backends manager and allow transparent support of different backends, so a user can switch the backend by simply linking the application to the correct one.

+

Backends may support different tuning options, but these are the default options available to the user for all of them

+
    +
  1. locale - the name of the locale in POSIX format like en_US.UTF-8
  2. +
  3. use_ansi_encoding - select system locale using ANSI codepages rather then UTF-8 under Windows by default
  4. +
  5. message_path - path to the location of message catalogs (vector of strings)
  6. +
  7. message_application - the name of applications that use message catalogs (vector of strings)
  8. +
+

Each backend can be installed with a different default priotiry so when you work with two different backends, you can specify priotiry so this backend will be chosen according to their priority.

+

Member Function Documentation

+ +
+
+ + + + + + + + +
virtual void boost::locale::localization_backend::clear_options ( )  [pure virtual]
+
+
+

Clear all options

+ +
+
+ +
+
+ + + + + + + + +
virtual localization_backend* boost::locale::localization_backend::clone ( )  const [pure virtual]
+
+
+

Make a polymorphic copy of the backend

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
virtual std::locale boost::locale::localization_backend::install (std::locale const &  base,
locale_category_type  category,
character_facet_type  type = nochar_facet 
) [pure virtual]
+
+
+

Create a facet for category category and character type type

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
virtual void boost::locale::localization_backend::set_option (std::string const &  name,
std::string const &  value 
) [pure virtual]
+
+
+

Set option for backend, for example "locale" or "encoding"

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1localization__backend__manager-members.html b/doc/html/classboost_1_1locale_1_1localization__backend__manager-members.html new file mode 100644 index 0000000..da8466d --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1localization__backend__manager-members.html @@ -0,0 +1,90 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::localization_backend_manager Member List

+
+ + + + diff --git a/doc/html/classboost_1_1locale_1_1localization__backend__manager.html b/doc/html/classboost_1_1locale_1_1localization__backend__manager.html new file mode 100644 index 0000000..eb02344 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1localization__backend__manager.html @@ -0,0 +1,345 @@ + + + + +Boost.Locale: boost::locale::localization_backend_manager Class Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::localization_backend_manager Class Reference

+
+
+ +

Localization backend manager is a class that holds various backend and allows creation of their combination or selection. +More...

+ +

#include <boost/locale/localization_backend.hpp>

+ +

List of all members.

+ + + + + + + + + + + + + + +

+Public Member Functions

 localization_backend_manager ()
 localization_backend_manager (localization_backend_manager const &)
localization_backend_manager
+const & 
operator= (localization_backend_manager const &)
 ~localization_backend_manager ()
std::auto_ptr
+< localization_backend
get () const
void add_backend (std::string const &name, std::auto_ptr< localization_backend > backend)
void remove_all_backends ()
std::vector< std::string > get_all_backends () const
void select (std::string const &backend_name, locale_category_type category=all_categories)

+Static Public Member Functions

static localization_backend_manager global (localization_backend_manager const &)
static localization_backend_manager global ()
+

Detailed Description

+

Localization backend manager is a class that holds various backend and allows creation of their combination or selection.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + +
boost::locale::localization_backend_manager::localization_backend_manager ( ) 
+
+ +
+ +
+
+ + + + + + + + + +
boost::locale::localization_backend_manager::localization_backend_manager (localization_backend_manager const &  ) 
+
+ +
+ +
+
+ + + + + + + + +
boost::locale::localization_backend_manager::~localization_backend_manager ( ) 
+
+
+

Destructor

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
void boost::locale::localization_backend_manager::add_backend (std::string const &  name,
std::auto_ptr< localization_backend backend 
)
+
+
+

Add new backend to the manager, each backend should be uniquely defined by its name.

+

This library provides: "icu", "posix", "winapi" and "std" backends.

+ +
+
+ +
+
+ + + + + + + + +
std::auto_ptr<localization_backend> boost::locale::localization_backend_manager::get ( )  const
+
+
+

Create new localization backend according to current settings.

+ +
+
+ +
+
+ + + + + + + + +
std::vector<std::string> boost::locale::localization_backend_manager::get_all_backends ( )  const
+
+
+

Get list of all available backends

+ +
+
+ +
+
+ + + + + + + + +
static localization_backend_manager boost::locale::localization_backend_manager::global ( )  [static]
+
+
+

Get global backend manager

+

This function is thread safe

+ +
+
+ +
+
+ + + + + + + + + +
static localization_backend_manager boost::locale::localization_backend_manager::global (localization_backend_manager const &  )  [static]
+
+
+

Set new global backend manager, the old one is returned.

+

This function is thread safe

+ +
+
+ +
+
+ + + + + + + + + +
localization_backend_manager const& boost::locale::localization_backend_manager::operator= (localization_backend_manager const &  ) 
+
+ +
+ +
+
+ + + + + + + + +
void boost::locale::localization_backend_manager::remove_all_backends ( ) 
+
+
+

Clear backend

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
void boost::locale::localization_backend_manager::select (std::string const &  backend_name,
locale_category_type  category = all_categories 
)
+
+
+

Select specific backend by name for a category category. It allows combining different backends for user preferences.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1message__format-members.html b/doc/html/classboost_1_1locale_1_1message__format-members.html new file mode 100644 index 0000000..7bddbf9 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1message__format-members.html @@ -0,0 +1,87 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::message_format< CharType > Member List

+
+
+This is the complete list of members for boost::locale::message_format< CharType >, including all inherited members. + + + + + + + + +
char_type typedefboost::locale::message_format< CharType >
convert(char_type const *msg, string_type &buffer) const =0boost::locale::message_format< CharType > [pure virtual]
domain(std::string const &domain) const =0boost::locale::message_format< CharType > [pure virtual]
get(int domain_id, char_type const *context, char_type const *id) const =0boost::locale::message_format< CharType > [pure virtual]
get(int domain_id, char_type const *context, char_type const *single_id, int n) const =0boost::locale::message_format< CharType > [pure virtual]
message_format(size_t refs=0)boost::locale::message_format< CharType > [inline]
string_type typedefboost::locale::message_format< CharType >
~message_format() (defined in boost::locale::message_format< CharType >)boost::locale::message_format< CharType > [inline, protected, virtual]
+ + + diff --git a/doc/html/classboost_1_1locale_1_1message__format.html b/doc/html/classboost_1_1locale_1_1message__format.html new file mode 100644 index 0000000..a6dfc8f --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1message__format.html @@ -0,0 +1,137 @@ + + + + +Boost.Locale: boost::locale::message_format< CharType > Class Template Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::message_format< CharType > Class Template Reference
+ +[Message Formatting (translation)] +

+
+
+ +

This facet provides message formatting abilities. +More...

+ +

#include <boost/locale/message.hpp>

+ +

List of all members.

+ + + + + + + + + + +

+Public Types

typedef CharType char_type
typedef std::basic_string
+< CharType > 
string_type

+Public Member Functions

 message_format (size_t refs=0)
virtual char_type const * get (int domain_id, char_type const *context, char_type const *id) const =0
virtual char_type const * get (int domain_id, char_type const *context, char_type const *single_id, int n) const =0
virtual int domain (std::string const &domain) const =0
virtual char_type const * convert (char_type const *msg, string_type &buffer) const =0
+

Detailed Description

+

template<typename CharType>
+ class boost::locale::message_format< CharType >

+ +

This facet provides message formatting abilities.

+

Member Typedef Documentation

+ +
+
+
+template<typename CharType>
+ + + + +
typedef CharType boost::locale::message_format< CharType >::char_type
+
+
+

Character type

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1period_1_1period__type-members.html b/doc/html/classboost_1_1locale_1_1period_1_1period__type-members.html new file mode 100644 index 0000000..c0002f3 --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1period_1_1period__type-members.html @@ -0,0 +1,83 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::period::period_type Member List

+
+
+This is the complete list of members for boost::locale::period::period_type, including all inherited members. + + + + +
mark() const boost::locale::period::period_type [inline]
operator!=(period_type const &other) const boost::locale::period::period_type [inline]
operator==(period_type const &other) const boost::locale::period::period_type [inline]
period_type(marks::period_mark m=marks::invalid)boost::locale::period::period_type [inline]
+ + + diff --git a/doc/html/classboost_1_1locale_1_1period_1_1period__type.html b/doc/html/classboost_1_1locale_1_1period_1_1period__type.html new file mode 100644 index 0000000..9d91bcc --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1period_1_1period__type.html @@ -0,0 +1,187 @@ + + + + +Boost.Locale: boost::locale::period::period_type Class Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::period::period_type Class Reference

+
+
+ +

This class holds a type that represents certain period of time like year, hour, second and so on. +More...

+ +

#include <boost/locale/date_time_facet.hpp>

+ +

List of all members.

+ + + + + + +

+Public Member Functions

 period_type (marks::period_mark m=marks::invalid)
marks::period_mark mark () const
bool operator== (period_type const &other) const
bool operator!= (period_type const &other) const
+

Detailed Description

+

This class holds a type that represents certain period of time like year, hour, second and so on.

+

It can be created from either marks::period_mark type or by using shortcuts in period namespace - calling functions like period::year(), period::hour() and so on.

+

Basically it represents the same object as enum marks::period_mark but allows to provide save operator overloading that would not collide with casing of enum to numeric values.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + +
boost::locale::period::period_type::period_type (marks::period_mark  m = marks::invalid )  [inline]
+
+
+

Create a period of specific type, default is invalid.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + +
marks::period_mark boost::locale::period::period_type::mark ( )  const [inline]
+
+
+

Get the value of marks::period_mark it was created with.

+ +
+
+ +
+
+ + + + + + + + + +
bool boost::locale::period::period_type::operator!= (period_type const &  other )  const [inline]
+
+
+

Check if two periods are different

+ +
+
+ +
+
+ + + + + + + + + +
bool boost::locale::period::period_type::operator== (period_type const &  other )  const [inline]
+
+
+

Check if two periods are the same

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classboost_1_1locale_1_1util_1_1base__converter-members.html b/doc/html/classboost_1_1locale_1_1util_1_1base__converter-members.html new file mode 100644 index 0000000..ecf034d --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1util_1_1base__converter-members.html @@ -0,0 +1,87 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::util::base_converter Member List

+
+
+This is the complete list of members for boost::locale::util::base_converter, including all inherited members. + + + + + + + + +
clone() const boost::locale::util::base_converter [inline, virtual]
from_unicode(uint32_t u, char *begin, char const *end)boost::locale::util::base_converter [inline, virtual]
illegalboost::locale::util::base_converter [static]
incompleteboost::locale::util::base_converter [static]
is_thread_safe() const boost::locale::util::base_converter [inline, virtual]
max_len() const boost::locale::util::base_converter [inline, virtual]
to_unicode(char const *&begin, char const *end)boost::locale::util::base_converter [inline, virtual]
~base_converter() (defined in boost::locale::util::base_converter)boost::locale::util::base_converter [inline, virtual]
+ + + diff --git a/doc/html/classboost_1_1locale_1_1util_1_1base__converter.html b/doc/html/classboost_1_1locale_1_1util_1_1base__converter.html new file mode 100644 index 0000000..d4b265a --- /dev/null +++ b/doc/html/classboost_1_1locale_1_1util_1_1base__converter.html @@ -0,0 +1,272 @@ + + + + +Boost.Locale: boost::locale::util::base_converter Class Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::util::base_converter Class Reference

+
+
+ +

This class represent a simple stateless converter from UCS-4 and to UCS-4 for each single code point. +More...

+ +

#include <boost/locale/util.hpp>

+ +

List of all members.

+ + + + + + + + + + +

+Public Member Functions

virtual int max_len () const
virtual bool is_thread_safe () const
virtual base_converterclone () const
virtual uint32_t to_unicode (char const *&begin, char const *end)
virtual uint32_t from_unicode (uint32_t u, char *begin, char const *end)

+Static Public Attributes

static const uint32_t illegal = 0xFFFFFFFF
static const uint32_t incomplete = 0xFFFFFFFE
+

Detailed Description

+

This class represent a simple stateless converter from UCS-4 and to UCS-4 for each single code point.

+

This class is used for creation of std::codecvt facet for converting utf-16/utf-32 encoding to encoding supported by this converter

+

Please note, this converter should be fully stateless. Fully stateless means it should never assume that it is called in any specific order on the text. Even if the encoding itself seems to be stateless like windows-1255 or shift-jis, some encoders (most notably iconv) can actually compose several code-point into one or decompose them in case composite characters are found. So be very careful when implementing these converters for certain character set.

+

Member Function Documentation

+ +
+
+ + + + + + + + +
virtual base_converter* boost::locale::util::base_converter::clone ( )  const [inline, virtual]
+
+
+

Create a polymorphic copy of this object, usually called only if is_thread_safe() return false

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
virtual uint32_t boost::locale::util::base_converter::from_unicode (uint32_t  u,
char *  begin,
char const *  end 
) [inline, virtual]
+
+
+

Convert a single code-point u into encoding and store it in [begin,end) range.

+

If u is invalid Unicode code-point, or it can not be mapped correctly to represented character set, illegal should be returned

+

If u can be converted to a sequence of bytes c1, ... , cN (1<= N <= max_len() ) then

+
    +
  1. If end - begin >= N, c1, ... cN are written starting at begin and N is returned
  2. +
  3. If end - begin < N, incomplete is returned, it is unspecified what would be stored in bytes in range [begin,end)
  4. +
+ +
+
+ +
+
+ + + + + + + + +
virtual bool boost::locale::util::base_converter::is_thread_safe ( )  const [inline, virtual]
+
+
+

Returns true if calling the functions from_unicode, to_unicode, and max_len is thread safe.

+

Rule of thumb: if this class' implementation uses simple tables that are unchanged or is purely algorithmic like UTF-8 - so it does not share any mutable bit for independent to_unicode, from_unicode calls, you may set it to true, otherwise, for example if you use iconv_t descriptor or UConverter as conversion object return false, and this object will be cloned for each use.

+ +
+
+ +
+
+ + + + + + + + +
virtual int boost::locale::util::base_converter::max_len ( )  const [inline, virtual]
+
+
+

Return the maximal length that one Unicode code-point can be converted to, for example for UTF-8 it is 4, for Shift-JIS it is 2 and ISO-8859-1 is 1

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
virtual uint32_t boost::locale::util::base_converter::to_unicode (char const *&  begin,
char const *  end 
) [inline, virtual]
+
+
+

Convert a single character starting at begin and ending at most at end to Unicode code-point.

+

if valid input sequence found in [begin,code_point_end) such as begin < code_point_end && code_point_end <= end it is converted to its Unicode code point equivalent, begin is set to code_point_end

+

if incomplete input sequence found in [begin,end), i.e. there my be such code_point_end that code_point_end > end and [begin, code_point_end) would be valid input sequence, then incomplete is returned begin stays unchanged, for example for UTF-8 conversion a *begin = 0xc2, begin +1 = end is such situation.

+

if invalid input sequence found, i.e. there there is a sequence [begin, code_point_end) such as code_point_end <= end that is illegal for this encoding, illegal is returned and begin stays unchanged. For example if *begin = 0xFF and begin < end for UTF-8, then illegal is returned.

+ +
+
+

Member Data Documentation

+ +
+
+ + + + +
const uint32_t boost::locale::util::base_converter::illegal = 0xFFFFFFFF [static]
+
+
+

This value should be returned when an illegal input sequence or code-point is observed: For example if a UCS-32 code-point is in the range reserved for UTF-16 surrogates or an invalid UTF-8 sequence is found

+ +
+
+ +
+
+ + + + +
const uint32_t boost::locale::util::base_converter::incomplete = 0xFFFFFFFE [static]
+
+
+

This value is returned in following cases: The of incomplete input sequence was found or insufficient output buffer was provided so complete output could not be written.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/doc/html/classes.html b/doc/html/classes.html new file mode 100644 index 0000000..11f69ca --- /dev/null +++ b/doc/html/classes.html @@ -0,0 +1,92 @@ + + + + +Boost.Locale: Alphabetical List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Class Index

+
+
+
A | B | C | D | G | H | I | L | M | P | S
+ +
  A  
+
  C  
+
  D  
+
  H  
+
  M  
+
abstract_calendar (boost::locale)   calendar (boost::locale)   date_time (boost::locale)   hold_ptr (boost::locale)   message_format (boost::locale)   
  B  
+
calendar_facet (boost::locale)   date_time_duration (boost::locale)   
  I  
+
messages_info (boost::locale::gnu_gettext)   
base_converter (boost::locale::util)   collator (boost::locale)   date_time_error (boost::locale)   info (boost::locale)   
  P  
+
basic_format (boost::locale)   collator_base (boost::locale)   date_time_period (boost::locale)   invalid_charset_error (boost::locale::conv)   period_type (boost::locale::period)   
basic_message (boost::locale)   comparator (boost::locale)   date_time_period_set (boost::locale)   ios_info (boost::locale)   posix_time (boost::locale)   
boundary_indexing (boost::locale::boundary)   conversion_error (boost::locale::conv)   messages_info::domain (boost::locale::gnu_gettext)   
  L  
+
  S  
+
boundary_point (boost::locale::boundary)   converter (boost::locale)   
  G  
+
localization_backend (boost::locale)   segment (boost::locale::boundary)   
boundary_point_index (boost::locale::boundary)   converter_base (boost::locale)   generator (boost::locale)   localization_backend_manager (boost::locale)   segment_index (boost::locale::boundary)   
break_info (boost::locale::boundary)   
A | B | C | D | G | H | I | L | M | P | S
+
+ + + diff --git a/doc/html/closed.png b/doc/html/closed.png new file mode 100644 index 0000000..b7d4bd9 Binary files /dev/null and b/doc/html/closed.png differ diff --git a/doc/html/collate_8cpp-example.html b/doc/html/collate_8cpp-example.html new file mode 100644 index 0000000..aec0e63 --- /dev/null +++ b/doc/html/collate_8cpp-example.html @@ -0,0 +1,108 @@ + + + + +Boost.Locale: collate.cpp + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

collate.cpp

+
+
+

Example of using collation functions

+
//
+//  Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
+//
+//  Distributed under the Boost Software License, Version 1.0. (See
+//  accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+//
+#include <iostream>
+#include <string>
+#include <set>
+
+#include <boost/locale.hpp>
+
+using namespace std;
+using namespace boost::locale;
+
+int main()
+{
+     generator gen;
+     std::locale::global(gen(""));
+
+     typedef std::set<std::string,std::locale> set_type;
+     set_type all_strings;
+
+     while(!cin.eof()) {
+          std::string tmp;
+          getline(cin,tmp);
+          all_strings.insert(tmp);
+     }
+     for(set_type::iterator p=all_strings.begin();p!=all_strings.end();++p) {
+          cout<<*p<<endl;
+     }
+
+}
+// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
+
+
+ + + diff --git a/doc/html/collation.html b/doc/html/collation.html new file mode 100644 index 0000000..12f38d4 --- /dev/null +++ b/doc/html/collation.html @@ -0,0 +1,96 @@ + + + + +Boost.Locale: Collation + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Collation

+
+
+

Boost.Locale provides a collator class, derived from std::collate, that adds support for primary, secondary, tertiary, quaternary and identical comparison levels. They can be approximately defined as:

+
    +
  1. Primary -- ignore accents and character case, comparing base letters only. For example "facade" and "Façade" are the same.
  2. +
  3. Secondary -- ignore character case but consider accents. "facade" and "façade" are different but "Façade" and "façade" are the same.
  4. +
  5. Tertiary -- consider both case and accents: "Façade" and "façade" are different. Ignore punctuation.
  6. +
  7. Quaternary -- consider all case, accents, and punctuation. The words must be identical in terms of Unicode representation.
  8. +
  9. Identical -- as quaternary, but compare code points as well.
  10. +
+

There are two ways of using the collator facet: directly, by calling its member functions compare, transform and hash, or indirectly by using the comparator template class in STL algorithms.

+

For example:

+
    wstring a=L"Façade", b=L"facade";
+    bool eq = 0 == use_facet<collator<wchar_t> >(loc).compare(collator_base::secondary,a,b);
+    wcout << a <<L" and "<<b<<L" are " << (eq ? L"identical" : L"different")<<endl;
+

std::locale is designed to be useful as a comparison class in STL collections and algorithms. To get similar functionality with comparison levels, you must use the comparator class.

+
    std::map<std::string,std::string,comparator<char,collator_base::secondary> > strings;
+    // Now strings uses the default system locale for string comparison
+

You can also set a specific locale or level when creating and using the comparator class:

+
    comparator<char> comp(some_locale,some_level);
+    std::map<std::string,std::string,comparator<char> > strings(comp);
+
+ + + diff --git a/doc/html/collator_8hpp_source.html b/doc/html/collator_8hpp_source.html new file mode 100644 index 0000000..18f5196 --- /dev/null +++ b/doc/html/collator_8hpp_source.html @@ -0,0 +1,221 @@ + + + + +Boost.Locale: boost/locale/collator.hpp Source File + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + diff --git a/doc/html/config_8hpp_source.html b/doc/html/config_8hpp_source.html new file mode 100644 index 0000000..ab2f762 --- /dev/null +++ b/doc/html/config_8hpp_source.html @@ -0,0 +1,133 @@ + + + + +Boost.Locale: boost/locale/config.hpp Source File + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + diff --git a/doc/html/conversion_8hpp_source.html b/doc/html/conversion_8hpp_source.html new file mode 100644 index 0000000..78b3e1f --- /dev/null +++ b/doc/html/conversion_8hpp_source.html @@ -0,0 +1,332 @@ + + + + +Boost.Locale: boost/locale/conversion.hpp Source File + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + diff --git a/doc/html/conversions.html b/doc/html/conversions.html new file mode 100644 index 0000000..a2b80d5 --- /dev/null +++ b/doc/html/conversions.html @@ -0,0 +1,127 @@ + + + + +Boost.Locale: Text Conversions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Text Conversions

+
+
+

There is a set of functions that perform basic string conversion operations: upper, lower and title case conversions, case folding and Unicode normalization. These are to_upper , to_lower, to_title, fold_case and normalize.

+

All these functions receive an std::locale object as parameter or use a global locale by default.

+

Global locale is used in all examples below.

+

+Case Handing

+

For example:

+
    std::string grussen = "grüßEN";
+    std::cout   <<"Upper "<< boost::locale::to_upper(grussen) << std::endl
+                <<"Lower "<< boost::locale::to_lower(grussen) << std::endl
+                <<"Title "<< boost::locale::to_title(grussen) << std::endl
+                <<"Fold  "<< boost::locale::fold_case(grussen) << std::endl;
+

Would print:

+
+Upper GRÜSSEN
+Lower grüßen
+Title Grüßen
+Fold  grüssen
+

You may notice that there are existing functions to_upper and to_lower in the Boost.StringAlgo library. The difference is that these function operate over an entire string instead of performing incorrect character-by-character conversions.

+

For example:

+
    std::wstring grussen = L"grüßen";
+    std::wcout << boost::algorithm::to_upper_copy(grussen) << " " << boost::locale::to_upper(grussen) << std::endl;
+

Would give in output:

+
+GRÜßEN GRÜSSEN
+

Where a letter "ß" was not converted correctly to double-S in first case because of a limitation of std::ctype facet.

+

This is even more problematic in case of UTF-8 encodings where non US-ASCII are not converted at all. For example, this code

+
    std::string grussen = "grüßen";
+    std::cout << boost::algorithm::to_upper_copy(grussen) << " " << boost::locale::to_upper(grussen) << std::endl;
+

Would modify ASCII characters only

+
+GRüßEN GRÜSSEN
+

+Unicode Normalization

+

Unicode normalization is the process of converting strings to a standard form, suitable for text processing and comparison. For example, character "ü" can be represented by a single code point or a combination of the character "u" and the diaeresis "¨". Normalization is an important part of Unicode text processing.

+

Unicode defines four normalization forms. Each specific form is selected by a flag passed to normalize function:

+
    +
  • NFD - Canonical decomposition - boost::locale::norm_nfd
  • +
  • NFC - Canonical decomposition followed by canonical composition - boost::locale::norm_nfc or boost::locale::norm_default
  • +
  • NFKD - Compatibility decomposition - boost::locale::norm_nfkd
  • +
  • NFKC - Compatibility decomposition followed by canonical composition - boost::locale::norm_nfkc
  • +
+

For more details on normalization forms, read this article.

+

+Notes

+
    +
  • normalize operates only on Unicode-encoded strings, i.e.: UTF-8, UTF-16 and UTF-32 depending on the character width. So be careful when using non-UTF encodings as they may be treated incorrectly.
  • +
  • fold_case is generally a locale-independent operation, but it receives a locale as a parameter to determine the 8-bit encoding.
  • +
  • All of these functions can work with an STL string, a NUL terminated string, or a range defined by two pointers. They always return a newly created STL string.
  • +
  • The length of the string may change, see the above example.
  • +
+
+ + + diff --git a/doc/html/conversions_8cpp-example.html b/doc/html/conversions_8cpp-example.html new file mode 100644 index 0000000..bba5f3f --- /dev/null +++ b/doc/html/conversions_8cpp-example.html @@ -0,0 +1,115 @@ + + + + +Boost.Locale: conversions.cpp + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

conversions.cpp

+
+
+

Example of using various text conversion functions.

+
//
+//  Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
+//
+//  Distributed under the Boost Software License, Version 1.0. (See
+//  accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+//
+#include <boost/locale.hpp>
+#include <boost/algorithm/string/case_conv.hpp>
+#include <iostream>
+
+#include <ctime>
+
+
+
+int main()
+{
+    using namespace boost::locale;
+    using namespace std;
+    // Create system default locale
+    generator gen;
+    locale loc=gen(""); 
+    locale::global(loc); 
+    cout.imbue(loc);
+
+    
+    cout<<"Correct case conversion can't be done by simple, character by character conversion"<<endl;
+    cout<<"because case conversion is context sensitive and not 1-to-1 conversion"<<endl;
+    cout<<"For example:"<<endl;
+    cout<<"   German grüßen correctly converted to "<<to_upper("grüßen")<<", instead of incorrect "
+                    <<boost::to_upper_copy(std::string("grüßen"))<<endl;
+    cout<<"     where ß is replaced with SS"<<endl;
+    cout<<"   Greek ὈΔΥΣΣΕΎΣ is correctly converted to "<<to_lower("ὈΔΥΣΣΕΎΣ")<<", instead of incorrect "
+                    <<boost::to_lower_copy(std::string("ὈΔΥΣΣΕΎΣ"))<<endl;
+    cout<<"     where Σ is converted to σ or to ς, according to position in the word"<<endl;
+    cout<<"Such type of conversion just can be done using std::toupper that work on character base, also std::toupper is "<<endl;
+    cout<<"not even applicable when working with variable character length like in UTF-8 or UTF-16 limiting the correct "<<endl;
+    cout<<"behavior to unicode subset BMP or ASCII only"<<endl;
+   
+}
+
+// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
+
+
+ + + diff --git a/doc/html/date__time_8hpp_source.html b/doc/html/date__time_8hpp_source.html new file mode 100644 index 0000000..94e9781 --- /dev/null +++ b/doc/html/date__time_8hpp_source.html @@ -0,0 +1,567 @@ + + + + +Boost.Locale: boost/locale/date_time.hpp Source File + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + diff --git a/doc/html/date__time__facet_8hpp_source.html b/doc/html/date__time__facet_8hpp_source.html new file mode 100644 index 0000000..ed325a1 --- /dev/null +++ b/doc/html/date__time__facet_8hpp_source.html @@ -0,0 +1,232 @@ + + + + +Boost.Locale: boost/locale/date_time_facet.hpp Source File + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + diff --git a/doc/html/dates_times_timezones.html b/doc/html/dates_times_timezones.html new file mode 100644 index 0000000..d831526 --- /dev/null +++ b/doc/html/dates_times_timezones.html @@ -0,0 +1,188 @@ + + + + +Boost.Locale: Working with dates, times, timezones and calendars. + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Working with dates, times, timezones and calendars.

+
+
+

+Introduction

+

There are several important flaws in the standard C, C++ and Boost libraries that handle dates and time:

+
    +
  1. The biggest flaw of most libraries that provide operations over dates is the fact that they only support the Gregorian calendar. boost::date_time , std::tm , and standard functions like localtime and gmtime, all assume the Gregorian calendar.
  2. +
  3. The information about local start of week is not provided.
    + For example the standard C and C++ library has mktime and localtime, but they do not give user the information about the first day of week. This information is locale dependent. It is Monday in France and it is Sunday in United States.
  4. +
+

Boost.Locale provides generic date_time, and calendar classes that allow you to perform operations on dates and times for non-Gregorian calendars such as Hebrew, Islamic, Japanese and others.

+

Non-ICU based backends support the Gregorian calendar only. Unlike boost::date_time, they are fully aware of the local first day of week. Thus, if the current day of week is Monday, then setting "current day of week" to Sunday would move the actual date 6 days forward in Russian or French locales and move one day backward in USA and Israeli locales.

+

+Handling Dates and Time

+
    +
  • boost::locale::calendar -- represents generic information about the calendar, independent from a specific time point. For example, you can get the maximum number of days in a month for a specific calendar.
  • +
  • boost::locale::date_time -- represents a time point. It is constructed from a calendar and allows manipulation of various time periods.
  • +
  • boost::locale::period -- holds a list of functions that represent various periods, such as month, year, day, and hour, allowing manipulation of dates and times. You can add periods, multiply them by integers, get or set them, or add them to date_time objects.
  • +
+

For example:

+
    using namespace boost::locale;
+    date_time now; // Create date_time class with default calendar initialized to current time
+    date_time tomorrow = now + period::day();
+    cout << "Let's meet tomorrow at " << as::date << tomorrow << endl;
+    date_time some_point = period::year(1995) + period::january() + period::day(1);
+    // Set some_point's date to 1995-Jan-1.
+    cout << "The "<< as::date << some_point << " is the " 
+        << as::ordinal << some_point / period::day_of_week_local() << " day of the week"  << endl;
+

You can calculate the difference between dates by dividing the difference by a period:

+
    date_time now;
+    cout << " There are " << (now + 2 * period::month() - now) / period::day() << " days "
+            "between " << as::date << now << " and " << now + 2*period::month() << endl;
+

You can also use different syntax (less operator overloading)

+
    date_time now;
+    cout << " There are " << period::day(now + period::month(2) - now) << " days "
+            "between " << as::date << now << " and " << now + period::month(2) << endl;
+

date_time -- provides the member functions minimum and maximum to get the information about smallest and largest possible values of a certain period for a specific time.

+

For example, for February the maximum(period::day()) would be 28 (or 29 for a leap year), and for January it would be 31.

+
Note:
Be very careful with assumptions about calendars. For example, in the Hebrew calendar, the number of months is different for leap years and non-leap years.
+

We recommend you to look at the calendar.cpp example provided with this library to get an understanding of how to manipulate dates and times using these classes.

+

To convert between various calendar dates, you may get the current POSIX time via the time member function.

+

For example:

+
    using namespace boost::locale;
+    using namespace boost::locale::period;
+    generator gen;
+    // Create locales with Hebrew and Gregorian (default) calendars.
+    std::locale l_hebrew=gen("en_US.UTF-8@calendar=hebrew");
+    std::locale l_gregorian=gen("en_US.UTF-8");
+    
+    // Create a Gregorian date from fields
+    date_time greg(year(2010) + february() + day(5),l_gregorian);
+    // Assign a time point taken from the Gregorian date to date_time with
+    // the Hebrew calendar
+    date_time heb(greg.time(),l_hebrew);
+    // Now we can query the year.
+    std::cout << "Hebrew year is " << heb / year << std::endl;
+
Note:
+

Non-ICU based backends support the same date-time range as mktime and localtime C library functions.

+
    +
  • Unix 32 bit: dates between 1901 and 2038
  • +
  • Unix 64 bit: dates from 1 BC
  • +
  • Windows: dates from 1970. If the time_t is 32 bits wide (mingw), then the upper limit is year 2038
  • +
+

+Time Zone

+

The current operating system's time zone is used by default, however the time zone can be modified at several different levels:

+
    +
  1. Calendar level: you can specify a timezone when creating a new instance of boost::locale::calendar in its constructor.
  2. +
  3. iostream level: you can use as::time_zone manipulator to set a specific time zone to the iostream so all dates and times would be represented in this time zone
  4. +
  5. You can specify the default global time zone by calling: boost::locale::time_zone::global(std::string const &). This time zone would be the default one for newly created iostream object and calendar instances.
  6. +
+
Note:
+

Non-ICU based backends support only two kinds of time zones:

+
    +
  1. The current OS time zone, as it is handled by localtime and mktime the standard library functions - the default time zone
  2. +
  3. Simple time zone in format "GMT+HH:MM" - the time zone represented using fixed shift from the UTC without support of daylight saving time.
  4. +
+

+I/O Operations on date_time objects

+

Writing a date_time is equivalent to:

+
    +
  • Applying as::datetime manipulator on the stream
  • +
  • Writing POSIX time as number that is fetched by calling date_time::time() function.
  • +
  • Reverting the manipulator effect back.
  • +
+

For example this code:

+
using namespace boost::locale;
+date_time now;
+std::cout << now << std::endl;
+

Would print in the default format, something like:

+
+2/3/2011 12:00 am
+

However if you need to change the default behavior (for example show only date), then you need to use specific iostream manipulator in order to display current date or time, it would override the default formatting.

+

For example

+
using namespace boost::locale;
+date_time now;
+std::cout << as::date << now << std::endl;
+

Would print something like:

+
+2/3/2011
+

This is important to remember that date_time object is always rendered and parsed in the context of the iostream's locale and time zone and not in the context of specific date_time object.

+

+Questions and Answers

+

Why should I use Boost.Locale over Boost.DateTime when I need Gregorian calendar only?

+
    +
  • Boost.DateTime is locale agnostic library and ignores the fact that the first day of week varies by the locale.
  • +
  • Boost.Locale provides a unified access to date and time in time zone aware way. It represents a time as universal scalar - the POSIX time and over that builds dates, local times and time-zones handling.
    + For example, date_time(some_time.time() + 3600) may be not equal to some_time + hour(), because of the daylight savings time.
  • +
+

Why don't you use Boost.DateTime time zone support?

+

Boost.DateTime's time zone support is broken. Time zones can not be represented with a simple table of rules where daylight saving depend only on certain n'th day of week in month. The daylight savings time may vary by year, political issues and many other things.

+

Most of the modern operating systems (Linux, *BSD, Mac OS X, OpenVMS) and many important software packages (ICU, Java, Python) use so called Olson database in order to handle daylight saving time correctly.

+

If you need full time zone database support, then you should use ICU library.

+
+ + + diff --git a/doc/html/default_encoding_under_windows.html b/doc/html/default_encoding_under_windows.html new file mode 100644 index 0000000..590ff85 --- /dev/null +++ b/doc/html/default_encoding_under_windows.html @@ -0,0 +1,105 @@ + + + + +Boost.Locale: Default Encoding under Microsoft Windows + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Default Encoding under Microsoft Windows

+
+
+

All modern operating systems use Unicode.

+
    +
  • Unix operating system family use UTF-8 encoding by default.
  • +
  • Microsoft Windows had migrated to Wide/UTF-16 API. The narrow encodings had been deprecated and the native OS API became so called "Wide API"
  • +
+

As a result of radically different approaches, it is very hard to write portable Unicode aware applications.

+

Boost Locale fully supports both narrow and wide API. The default character encoding is assumed to be UTF-8 on Windows.

+

So if the default operating system Locale is "English_USA.1252" the default locale for Boost.Locale on Windows would be "en_US.UTF-8".

+

When the created locale object is installed globally then any libraries that use std::codecvt for conversion between narrow API and the native wide API would handle UTF-8 correctly.

+

A good example of such library is Boost.Filesystem v3.

+

For example

+
#include <boost/locale.hpp>
+#include <boost/filesystem/path.hpp>
+#include <boost/filesystem/fstream.hpp>
+
+int main()
+{
+    // Create and install global locale
+    std::locale::global(boost::locale::generator().generate(""));
+    // Make boost.filesystem use it
+    boost::filesystem::path::imbue(std::locale());
+    // Now Works perfectly fine with UTF-8!
+    boost::filesystem::ofstream hello("שלום.txt"); 
+}
+

However such behavior may break existing software that assumes that the current encoding is single byte encodings like code page 1252.

+

boost::locale::generator class has a property use_ansi_encoding() that allows to change the behavior to legacy one and select an ANSI code page as default system encoding.

+

So, when the current locale is "English_USA.1252" and the use_ansi_encoding is turned on then the default locale would be "en_US.windows-1252"

+
Note:
winapi backend does not support ANSI encodings, thus UTF-8 encoding is always used for narrow characters.
+
+ + + diff --git a/doc/html/doxygen.css b/doc/html/doxygen.css new file mode 100644 index 0000000..658686f --- /dev/null +++ b/doc/html/doxygen.css @@ -0,0 +1,656 @@ +/* The standard CSS for doxygen */ + +body, table, div, p, dl { + font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif; + font-size: 12px; +} + +/* @group Heading Levels */ + +h1 { + font-size: 150%; +} + +h2 { + font-size: 120%; +} + +h3 { + font-size: 100%; +} + +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd, p.starttd { + margin-top: 2px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.qindex, div.navtab{ + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + padding: 2px; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #3D578C; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #4665A2; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #9CAFD4; + color: #ffffff; + border: 1px double #869DCA; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code { + color: #4665A2; +} + +a.codeRef { + color: #4665A2; +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +.fragment { + font-family: monospace, fixed; + font-size: 105%; +} + +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; +} + +div.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px; + padding: 0.2em; + border: solid thin #333; + border-radius: 0.5em; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + -webkit-box-shadow: 2px 2px 3px #999; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background: white; + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 10px; + margin-right: 10px; +} + +td.indexkey { + background-color: #EBEFF6; + font-weight: bold; + border: 1px solid #C4CFE5; + margin: 2px 0px 2px 0; + padding: 2px 10px; +} + +td.indexvalue { + background-color: #EBEFF6; + border: 1px solid #C4CFE5; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #EEF1F7; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3B4D7; +} + +th.dirtab { + background: #EBEFF6; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4A6AAA; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FAFC; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memItemLeft, .memItemRight, .memTemplParams { + border-top: 1px solid #C4CFE5; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memTemplParams { + color: #4665A2; + white-space: nowrap; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtemplate { + font-size: 80%; + color: #4665A2; + font-weight: normal; + margin-left: 3px; +} + +.memnav { + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.memitem { + padding: 0; + margin-bottom: 10px; +} + +.memname { + white-space: nowrap; + font-weight: bold; + margin-left: 6px; +} + +.memproto { + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 0px 6px 0px; + color: #253555; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 8px; + -moz-border-radius-topleft: 8px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 8px; + -webkit-border-top-left-radius: 8px; + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + +} + +.memdoc { + border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 2px 5px; + background-color: #FBFCFD; + border-top-width: 0; + /* firefox specific markup */ + -moz-border-radius-bottomleft: 8px; + -moz-border-radius-bottomright: 8px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7); + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 8px; + -webkit-border-bottom-right-radius: 8px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7)); +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} + +/* @end */ + +/* @group Directory (tree) */ + +/* for the tree view */ + +.ftvtree { + font-family: sans-serif; + margin: 0px; +} + +/* these are for tree view when used as main index */ + +.directory { + font-size: 9pt; + font-weight: bold; + margin: 5px; +} + +.directory h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +/* +The following two styles can be used to replace the root node title +with an image of your choice. Simply uncomment the next two styles, +specify the name of your image and be sure to set 'height' to the +proper pixel height of your image. +*/ + +/* +.directory h3.swap { + height: 61px; + background-repeat: no-repeat; + background-image: url("yourimage.gif"); +} +.directory h3.swap span { + display: none; +} +*/ + +.directory > h3 { + margin-top: 0; +} + +.directory p { + margin: 0px; + white-space: nowrap; +} + +.directory div { + display: none; + margin: 0px; +} + +.directory img { + vertical-align: -30%; +} + +/* these are for tree view when not used as main index */ + +.directory-alt { + font-size: 100%; + font-weight: bold; +} + +.directory-alt h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +.directory-alt > h3 { + margin-top: 0; +} + +.directory-alt p { + margin: 0px; + white-space: nowrap; +} + +.directory-alt div { + display: none; + margin: 0px; +} + +.directory-alt img { + vertical-align: -30%; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; +} + +address { + font-style: normal; + color: #2A3D61; +} + +table.doxtable { + border-collapse:collapse; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; +} + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + height:30px; + line-height:30px; + color:#8AA0CC; + border:solid 1px #C2CDE4; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right: 15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#364D7C; +} + +.navpath a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; +} + +.navpath a:hover +{ + color:#6884BD; +} + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +div.header +{ + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + diff --git a/doc/html/doxygen.png b/doc/html/doxygen.png new file mode 100644 index 0000000..635ed52 Binary files /dev/null and b/doc/html/doxygen.png differ diff --git a/doc/html/encoding_8hpp_source.html b/doc/html/encoding_8hpp_source.html new file mode 100644 index 0000000..a928b05 --- /dev/null +++ b/doc/html/encoding_8hpp_source.html @@ -0,0 +1,341 @@ + + + + +Boost.Locale: boost/locale/encoding.hpp Source File + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + diff --git a/doc/html/examples.html b/doc/html/examples.html new file mode 100644 index 0000000..988ff01 --- /dev/null +++ b/doc/html/examples.html @@ -0,0 +1,89 @@ + + + + +Boost.Locale: Examples + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Examples

+
+
+Here is a list of all examples: +
+ + + diff --git a/doc/html/facets_8hpp_source.html b/doc/html/facets_8hpp_source.html new file mode 100644 index 0000000..65a4dab --- /dev/null +++ b/doc/html/facets_8hpp_source.html @@ -0,0 +1,229 @@ + + + + +Boost.Locale: boost/locale/boundary/facets.hpp Source File + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + diff --git a/doc/html/faq.html b/doc/html/faq.html new file mode 100644 index 0000000..32b1086 --- /dev/null +++ b/doc/html/faq.html @@ -0,0 +1,102 @@ + + + + +Boost.Locale: Frequently Asked Questions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Frequently Asked Questions

+
+
+
    +
  • I try to use some Boost.Locale functions and I get an std::bad_cast exception thrown?
    +
    + Answer: You probably try to use incorrect std::locale object. All Boost.Locale tools relay on std::locale object's facets. The locale object should be generated with generator class and then passed to the function or alternatively global locale should be set using std::locale::global() function such that global locale (and default created one) would have required facets to use.
  • +
  • I had installed global locale and try to write something to stream but still get wrong output? For example:
        #include <boost/locale.hpp>
    +    #include <iostream>
    +    int main()
    +    {
    +        boost::locale::generator gen;
    +        std::locale::global(gen(""));
    +        std::cout << boost::locale::as::date << std::time(0) << std::endl;
    +    }
    +
    Prints a number instead of a date.
    + Answer: You forget to imbue the locale to the stream. Changing the global locale does not affect the locale in existing iostream objects. Thus because std::out and other global streams were created before changing the global locale Boost.Locale manipulators have no effect. You need to write:
        #include <boost/locale.hpp>
    +    #include <iostream>
    +    int main()
    +    {
    +        boost::locale::generator gen;
    +        std::locale l = gen("");
    +        std::locale::global(l);
    +        std::cout.imbue(l);
    +        std::cout << boost::locale::as::date << std::time(0) << std::endl;
    +    }
    +
  • +
+
+ + + diff --git a/doc/html/files.html b/doc/html/files.html new file mode 100644 index 0000000..6fb3be8 --- /dev/null +++ b/doc/html/files.html @@ -0,0 +1,100 @@ + + + + +Boost.Locale: File Index + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

File List

+
+
+Here is a list of all documented files with brief descriptions: + + + + + + + + + + + + + + + + + + + + + + +
boost/locale/boundary.hpp [code]
boost/locale/collator.hpp [code]
boost/locale/config.hpp [code]
boost/locale/conversion.hpp [code]
boost/locale/date_time.hpp [code]
boost/locale/date_time_facet.hpp [code]
boost/locale/encoding.hpp [code]
boost/locale/format.hpp [code]
boost/locale/formatting.hpp [code]
boost/locale/generator.hpp [code]
boost/locale/gnu_gettext.hpp [code]
boost/locale/hold_ptr.hpp [code]
boost/locale/info.hpp [code]
boost/locale/localization_backend.hpp [code]
boost/locale/message.hpp [code]
boost/locale/time_zone.hpp [code]
boost/locale/util.hpp [code]
boost/locale/boundary/boundary_point.hpp [code]
boost/locale/boundary/facets.hpp [code]
boost/locale/boundary/index.hpp [code]
boost/locale/boundary/segment.hpp [code]
boost/locale/boundary/types.hpp [code]
+
+ + + diff --git a/doc/html/format_8hpp_source.html b/doc/html/format_8hpp_source.html new file mode 100644 index 0000000..1c767cd --- /dev/null +++ b/doc/html/format_8hpp_source.html @@ -0,0 +1,468 @@ + + + + +Boost.Locale: boost/locale/format.hpp Source File + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + diff --git a/doc/html/formatting_8hpp_source.html b/doc/html/formatting_8hpp_source.html new file mode 100644 index 0000000..6bd7507 --- /dev/null +++ b/doc/html/formatting_8hpp_source.html @@ -0,0 +1,537 @@ + + + + +Boost.Locale: boost/locale/formatting.hpp Source File + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + diff --git a/doc/html/formatting_and_parsing.html b/doc/html/formatting_and_parsing.html new file mode 100644 index 0000000..24c068a --- /dev/null +++ b/doc/html/formatting_and_parsing.html @@ -0,0 +1,180 @@ + + + + +Boost.Locale: Numbers, Time and Currency formatting and parsing + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Numbers, Time and Currency formatting and parsing

+
+
+

All formatting and parsing is performed via the standard I/O streams. Each of the above information types is represented as a number. The formatting information is set using iostream manipulators. All manipulators are placed in the boost::locale::as namespace.

+

For example:

+
    cout << as::currency << 123.45 << endl;
+    // display 123.45 in local currency representation.
+    cin >> as::currency >> x ;
+    // Parse currency representation and store it in x
+

There is a special manipulator as::posix that "unsets" locale-specific settings and returns them to the default iostream formatting and parsing methods. Please note, such formats may still be localized by the default std::num_put and std::num_get facets.

+

+Numbers and number manipulators

+

Here are the manipulators for number formatting:

+
    +
  • as::number -- format number according to local specifications, it takes into account various std::ios_base flags like scientific format and precision.
    +
  • +
  • as::percent -- format number as "percent" format. For example:
            cout << as::percent << 0.25 <<endl;
    +
    Would create an output that may look like this:
    +    25%
    +    

    +
  • +
  • as::spellout -- spell the number. For example, under the English locale, 103 may be displayed as "one hundred three". Note: not all locales provide rules for spelling numbers. In such a case the number would be displayed in decimal format.
    +
  • +
  • as::ordinal -- display an order-of element. For example "2" would be displayed as "2nd" under the English locale. As in the above case, not all locales provide ordinal rules.
  • +
+

+Currency formatting

+

These are the manipulators for currency formatting:

+
    +
  • as::currency -- set the format to currency mode.
  • +
  • as::currency_iso -- change the currency format to international, like "USD" instead of "$". This flag is supported when using ICU 4.2 and above.
  • +
  • as::currency_national -- change currency format to national, like "$".
  • +
  • as::currency_default -- return to the default (national) currency format.
  • +
+
Note:
as::currency_XYZ manipulators have no effect on general formatting, only on the currency format. You must use both currency and number manipulators to use a non-default format.
+

+Date and Time formatting

+

Dates and times are represented as POSIX time. When date-time formatting is turned on in the iostream, each number is treated as a POSIX time. The number may be an integer or a double.

+

There are four major manipulators for Date and Time formatting:

+
    +
  • as::date -- date only
  • +
  • as::time -- time only
  • +
  • as::datetime -- both date and time
  • +
  • as::ftime -- parameterized manipulator that allows specification of time in the format that is used in the strftime function. Note: not all formatting flags of strftime are supported.
  • +
+

For example:

+
    time_t now=time(0);
+    cout << "Today is "<< as::date << now << " and tomorrow is " << now+24*3600 << endl;
+    cout << "Current time is "<< as::time << now << endl;
+    cout << "The current weekday is "<< as::ftime("%A") << now << endl;
+

More fine-grained control of date-time formatting is also available:

+
    +
  • as::time_default , as::time_short , as::time_medium , as::time_long , as::time_full -- change time formatting.
  • +
  • as::date_default , as::date_short , as::date_medium , as::date_long , as::date_full -- change date formatting.
  • +
+

These manipulators, when used together with the as::date, as::time, or as::datetime manipulators, change the date-time representation. The default format is medium.

+

By default, the date and time are shown in the local time zone. This behavior may be changed with the following manipulators:

+
    +
  • as::gmt -- display date and time in GMT.
  • +
  • as::local_time -- display in local time zone (default).
  • +
  • as::time_zone -- parameterized manipulator that sets the time-zone ID for date-time formatting and parsing. It takes a string parameter that represents the time zone ID.
  • +
+

For example:

+
    double now=time(0);
+    cout << as::datetime << as::local_time << "Local time is: "<< now << endl;
+    cout << as::gmt << "GMT Time is: "<< now <<endl;
+    cout << as::time_zone("EST") << "Eastern Standard Time is: "<< now <<endl;
+

There is a list of supported strftime flags by ICU backend:

+
    +
  • %a -- Abbreviated weekday (Sun.)
  • +
  • %A -- Full weekday (Sunday)
  • +
  • %b -- Abbreviated month (Jan.)
  • +
  • %B -- Full month (January)
  • +
  • %c -- Locale date-time format. Note: prefer using as::datetime
  • +
  • %d -- Day of Month [01,31]
  • +
  • %e -- Day of Month [1,31]
  • +
  • %h -- Same as %b
  • +
  • %H -- 24 clock hour [00,23]
  • +
  • %I -- 12 clock hour [01,12]
  • +
  • %j -- Day of year [1,366]
  • +
  • %m -- Month [01,12]
  • +
  • %M -- Minute [00,59]
  • +
  • %n -- New Line
  • +
  • %p -- AM/PM in locale representation
  • +
  • %r -- Time with AM/PM, same as %I:%M:%S %p
  • +
  • %R -- Same as %H:%M
  • +
  • %S -- Second [00,61]
  • +
  • %t -- Tab character
  • +
  • %T -- Same as %H:%M:%S
  • +
  • %x -- Local date representation. **Note:** prefer using as::date
  • +
  • %X -- Local time representation. **Note:** prefer using as::time
  • +
  • %y -- Year [00,99]
  • +
  • %Y -- 4 digits year. (2009)
  • +
  • %Z -- Time Zone
  • +
  • %% -- Percent symbol
  • +
+

Unsupported strftime flags are: %C , %u , %U , %V , %w , %W . Also, the O and E modifiers are not supported.

+

General recommendations

+
    +
  • Prefer using generic date-time manipulators rather than specifying the full format using as::ftime.
  • +
  • Remember that current calendars may be not Gregorian.
  • +
+

+Internals

+

Formatting information is stored in a stream class by using the xalloc, pword, and register_callback member functions of std::ios_base . All the information is stored and managed using a special object bound to iostream, and the manipulators just change its state.

+

When a number is written to or read from the stream, a custom Boost.Locale facet accesses the object and checks the required formatting information. Then it creates a special object that actually formats the number and caches it in the iostream. The next time a number is written to the stream, the same formatter would be used unless some flags had changed and formatter object is invalid.

+
+ + + diff --git a/doc/html/ftv2blank.png b/doc/html/ftv2blank.png new file mode 100644 index 0000000..493c3c0 Binary files /dev/null and b/doc/html/ftv2blank.png differ diff --git a/doc/html/ftv2doc.png b/doc/html/ftv2doc.png new file mode 100644 index 0000000..f72999f Binary files /dev/null and b/doc/html/ftv2doc.png differ diff --git a/doc/html/ftv2folderclosed.png b/doc/html/ftv2folderclosed.png new file mode 100644 index 0000000..d6d0634 Binary files /dev/null and b/doc/html/ftv2folderclosed.png differ diff --git a/doc/html/ftv2folderopen.png b/doc/html/ftv2folderopen.png new file mode 100644 index 0000000..bbe2c91 Binary files /dev/null and b/doc/html/ftv2folderopen.png differ diff --git a/doc/html/ftv2lastnode.png b/doc/html/ftv2lastnode.png new file mode 100644 index 0000000..e7b9ba9 Binary files /dev/null and b/doc/html/ftv2lastnode.png differ diff --git a/doc/html/ftv2link.png b/doc/html/ftv2link.png new file mode 100644 index 0000000..14f3fed Binary files /dev/null and b/doc/html/ftv2link.png differ diff --git a/doc/html/ftv2mlastnode.png b/doc/html/ftv2mlastnode.png new file mode 100644 index 0000000..09ceb6a Binary files /dev/null and b/doc/html/ftv2mlastnode.png differ diff --git a/doc/html/ftv2mnode.png b/doc/html/ftv2mnode.png new file mode 100644 index 0000000..3254c05 Binary files /dev/null and b/doc/html/ftv2mnode.png differ diff --git a/doc/html/ftv2node.png b/doc/html/ftv2node.png new file mode 100644 index 0000000..c9f06a5 Binary files /dev/null and b/doc/html/ftv2node.png differ diff --git a/doc/html/ftv2plastnode.png b/doc/html/ftv2plastnode.png new file mode 100644 index 0000000..0b07e00 Binary files /dev/null and b/doc/html/ftv2plastnode.png differ diff --git a/doc/html/ftv2pnode.png b/doc/html/ftv2pnode.png new file mode 100644 index 0000000..2001b79 Binary files /dev/null and b/doc/html/ftv2pnode.png differ diff --git a/doc/html/ftv2vertline.png b/doc/html/ftv2vertline.png new file mode 100644 index 0000000..b330f3a Binary files /dev/null and b/doc/html/ftv2vertline.png differ diff --git a/doc/html/functions.html b/doc/html/functions.html new file mode 100644 index 0000000..1ed50a6 --- /dev/null +++ b/doc/html/functions.html @@ -0,0 +1,141 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented class members with links to the class documentation for each member: + +

- a -

+
+ + + diff --git a/doc/html/functions_0x62.html b/doc/html/functions_0x62.html new file mode 100644 index 0000000..df581e6 --- /dev/null +++ b/doc/html/functions_0x62.html @@ -0,0 +1,141 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + + diff --git a/doc/html/functions_0x63.html b/doc/html/functions_0x63.html new file mode 100644 index 0000000..05c15d0 --- /dev/null +++ b/doc/html/functions_0x63.html @@ -0,0 +1,203 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented class members with links to the class documentation for each member: + +

- c -

+
+ + + diff --git a/doc/html/functions_0x64.html b/doc/html/functions_0x64.html new file mode 100644 index 0000000..cebf165 --- /dev/null +++ b/doc/html/functions_0x64.html @@ -0,0 +1,170 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented class members with links to the class documentation for each member: + +

- d -

+
+ + + diff --git a/doc/html/functions_0x65.html b/doc/html/functions_0x65.html new file mode 100644 index 0000000..067f959 --- /dev/null +++ b/doc/html/functions_0x65.html @@ -0,0 +1,131 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + + diff --git a/doc/html/functions_0x66.html b/doc/html/functions_0x66.html new file mode 100644 index 0000000..9cc4bad --- /dev/null +++ b/doc/html/functions_0x66.html @@ -0,0 +1,130 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented class members with links to the class documentation for each member: + +

- f -

+
+ + + diff --git a/doc/html/functions_0x67.html b/doc/html/functions_0x67.html new file mode 100644 index 0000000..f4508df --- /dev/null +++ b/doc/html/functions_0x67.html @@ -0,0 +1,163 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented class members with links to the class documentation for each member: + +

- g -

+
+ + + diff --git a/doc/html/functions_0x68.html b/doc/html/functions_0x68.html new file mode 100644 index 0000000..5c1f7af --- /dev/null +++ b/doc/html/functions_0x68.html @@ -0,0 +1,120 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented class members with links to the class documentation for each member: + +

- h -

+
+ + + diff --git a/doc/html/functions_0x69.html b/doc/html/functions_0x69.html new file mode 100644 index 0000000..e5a0ff7 --- /dev/null +++ b/doc/html/functions_0x69.html @@ -0,0 +1,164 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + + diff --git a/doc/html/functions_0x6c.html b/doc/html/functions_0x6c.html new file mode 100644 index 0000000..0cde4f7 --- /dev/null +++ b/doc/html/functions_0x6c.html @@ -0,0 +1,143 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented class members with links to the class documentation for each member: + +

- l -

+
+ + + diff --git a/doc/html/functions_0x6d.html b/doc/html/functions_0x6d.html new file mode 100644 index 0000000..e776e46 --- /dev/null +++ b/doc/html/functions_0x6d.html @@ -0,0 +1,142 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + + diff --git a/doc/html/functions_0x6e.html b/doc/html/functions_0x6e.html new file mode 100644 index 0000000..f7a2164 --- /dev/null +++ b/doc/html/functions_0x6e.html @@ -0,0 +1,130 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented class members with links to the class documentation for each member: + +

- n -

+
+ + + diff --git a/doc/html/functions_0x6f.html b/doc/html/functions_0x6f.html new file mode 100644 index 0000000..eec2547 --- /dev/null +++ b/doc/html/functions_0x6f.html @@ -0,0 +1,212 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented class members with links to the class documentation for each member: + +

- o -

+
+ + + diff --git a/doc/html/functions_0x70.html b/doc/html/functions_0x70.html new file mode 100644 index 0000000..f898478 --- /dev/null +++ b/doc/html/functions_0x70.html @@ -0,0 +1,123 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented class members with links to the class documentation for each member: + +

- p -

+
+ + + diff --git a/doc/html/functions_0x71.html b/doc/html/functions_0x71.html new file mode 100644 index 0000000..b088c47 --- /dev/null +++ b/doc/html/functions_0x71.html @@ -0,0 +1,117 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented class members with links to the class documentation for each member: + +

- q -

+
+ + + diff --git a/doc/html/functions_0x72.html b/doc/html/functions_0x72.html new file mode 100644 index 0000000..f653db3 --- /dev/null +++ b/doc/html/functions_0x72.html @@ -0,0 +1,134 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + + diff --git a/doc/html/functions_0x73.html b/doc/html/functions_0x73.html new file mode 100644 index 0000000..0e6083c --- /dev/null +++ b/doc/html/functions_0x73.html @@ -0,0 +1,183 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented class members with links to the class documentation for each member: + +

- s -

+
+ + + diff --git a/doc/html/functions_0x74.html b/doc/html/functions_0x74.html new file mode 100644 index 0000000..ef95fc2 --- /dev/null +++ b/doc/html/functions_0x74.html @@ -0,0 +1,138 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented class members with links to the class documentation for each member: + +

- t -

+
+ + + diff --git a/doc/html/functions_0x75.html b/doc/html/functions_0x75.html new file mode 100644 index 0000000..3068418 --- /dev/null +++ b/doc/html/functions_0x75.html @@ -0,0 +1,129 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented class members with links to the class documentation for each member: + +

- u -

+
+ + + diff --git a/doc/html/functions_0x76.html b/doc/html/functions_0x76.html new file mode 100644 index 0000000..9c77115 --- /dev/null +++ b/doc/html/functions_0x76.html @@ -0,0 +1,130 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + + diff --git a/doc/html/functions_0x77.html b/doc/html/functions_0x77.html new file mode 100644 index 0000000..0ee08cd --- /dev/null +++ b/doc/html/functions_0x77.html @@ -0,0 +1,118 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented class members with links to the class documentation for each member: + +

- w -

+
+ + + diff --git a/doc/html/functions_0x7e.html b/doc/html/functions_0x7e.html new file mode 100644 index 0000000..3802179 --- /dev/null +++ b/doc/html/functions_0x7e.html @@ -0,0 +1,120 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented class members with links to the class documentation for each member: + +

- ~ -

+
+ + + diff --git a/doc/html/functions_enum.html b/doc/html/functions_enum.html new file mode 100644 index 0000000..5492b45 --- /dev/null +++ b/doc/html/functions_enum.html @@ -0,0 +1,107 @@ + + + + +Boost.Locale: Class Members - Enumerations + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+ + + diff --git a/doc/html/functions_eval.html b/doc/html/functions_eval.html new file mode 100644 index 0000000..65bfe49 --- /dev/null +++ b/doc/html/functions_eval.html @@ -0,0 +1,167 @@ + + + + +Boost.Locale: Class Members - Enumerator + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+ + + diff --git a/doc/html/functions_func.html b/doc/html/functions_func.html new file mode 100644 index 0000000..b9e02eb --- /dev/null +++ b/doc/html/functions_func.html @@ -0,0 +1,128 @@ + + + + +Boost.Locale: Class Members - Functions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- a -

+
+ + + diff --git a/doc/html/functions_func_0x62.html b/doc/html/functions_func_0x62.html new file mode 100644 index 0000000..eaa0eb4 --- /dev/null +++ b/doc/html/functions_func_0x62.html @@ -0,0 +1,136 @@ + + + + +Boost.Locale: Class Members - Functions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + + diff --git a/doc/html/functions_func_0x63.html b/doc/html/functions_func_0x63.html new file mode 100644 index 0000000..f2ad0c2 --- /dev/null +++ b/doc/html/functions_func_0x63.html @@ -0,0 +1,168 @@ + + + + +Boost.Locale: Class Members - Functions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + + diff --git a/doc/html/functions_func_0x64.html b/doc/html/functions_func_0x64.html new file mode 100644 index 0000000..10999d1 --- /dev/null +++ b/doc/html/functions_func_0x64.html @@ -0,0 +1,160 @@ + + + + +Boost.Locale: Class Members - Functions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- d -

+
+ + + diff --git a/doc/html/functions_func_0x65.html b/doc/html/functions_func_0x65.html new file mode 100644 index 0000000..3fd220d --- /dev/null +++ b/doc/html/functions_func_0x65.html @@ -0,0 +1,126 @@ + + + + +Boost.Locale: Class Members - Functions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + + diff --git a/doc/html/functions_func_0x66.html b/doc/html/functions_func_0x66.html new file mode 100644 index 0000000..b4f05d1 --- /dev/null +++ b/doc/html/functions_func_0x66.html @@ -0,0 +1,126 @@ + + + + +Boost.Locale: Class Members - Functions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + + diff --git a/doc/html/functions_func_0x67.html b/doc/html/functions_func_0x67.html new file mode 100644 index 0000000..25b6110 --- /dev/null +++ b/doc/html/functions_func_0x67.html @@ -0,0 +1,161 @@ + + + + +Boost.Locale: Class Members - Functions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + + diff --git a/doc/html/functions_func_0x68.html b/doc/html/functions_func_0x68.html new file mode 100644 index 0000000..4e52e00 --- /dev/null +++ b/doc/html/functions_func_0x68.html @@ -0,0 +1,119 @@ + + + + +Boost.Locale: Class Members - Functions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- h -

+
+ + + diff --git a/doc/html/functions_func_0x69.html b/doc/html/functions_func_0x69.html new file mode 100644 index 0000000..3412f96 --- /dev/null +++ b/doc/html/functions_func_0x69.html @@ -0,0 +1,134 @@ + + + + +Boost.Locale: Class Members - Functions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- i -

+
+ + + diff --git a/doc/html/functions_func_0x6c.html b/doc/html/functions_func_0x6c.html new file mode 100644 index 0000000..1c82fad --- /dev/null +++ b/doc/html/functions_func_0x6c.html @@ -0,0 +1,128 @@ + + + + +Boost.Locale: Class Members - Functions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- l -

+
+ + + diff --git a/doc/html/functions_func_0x6d.html b/doc/html/functions_func_0x6d.html new file mode 100644 index 0000000..ea85ef7 --- /dev/null +++ b/doc/html/functions_func_0x6d.html @@ -0,0 +1,135 @@ + + + + +Boost.Locale: Class Members - Functions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + + diff --git a/doc/html/functions_func_0x6e.html b/doc/html/functions_func_0x6e.html new file mode 100644 index 0000000..0c8fa32 --- /dev/null +++ b/doc/html/functions_func_0x6e.html @@ -0,0 +1,119 @@ + + + + +Boost.Locale: Class Members - Functions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- n -

+
+ + + diff --git a/doc/html/functions_func_0x6f.html b/doc/html/functions_func_0x6f.html new file mode 100644 index 0000000..9339a4c --- /dev/null +++ b/doc/html/functions_func_0x6f.html @@ -0,0 +1,207 @@ + + + + +Boost.Locale: Class Members - Functions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- o -

+
+ + + diff --git a/doc/html/functions_func_0x70.html b/doc/html/functions_func_0x70.html new file mode 100644 index 0000000..63216b2 --- /dev/null +++ b/doc/html/functions_func_0x70.html @@ -0,0 +1,116 @@ + + + + +Boost.Locale: Class Members - Functions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- p -

+
+ + + diff --git a/doc/html/functions_func_0x72.html b/doc/html/functions_func_0x72.html new file mode 100644 index 0000000..b7bce0e --- /dev/null +++ b/doc/html/functions_func_0x72.html @@ -0,0 +1,128 @@ + + + + +Boost.Locale: Class Members - Functions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + + diff --git a/doc/html/functions_func_0x73.html b/doc/html/functions_func_0x73.html new file mode 100644 index 0000000..ff5703e --- /dev/null +++ b/doc/html/functions_func_0x73.html @@ -0,0 +1,162 @@ + + + + +Boost.Locale: Class Members - Functions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + + diff --git a/doc/html/functions_func_0x74.html b/doc/html/functions_func_0x74.html new file mode 100644 index 0000000..65838c8 --- /dev/null +++ b/doc/html/functions_func_0x74.html @@ -0,0 +1,128 @@ + + + + +Boost.Locale: Class Members - Functions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- t -

+
+ + + diff --git a/doc/html/functions_func_0x75.html b/doc/html/functions_func_0x75.html new file mode 100644 index 0000000..135d859 --- /dev/null +++ b/doc/html/functions_func_0x75.html @@ -0,0 +1,119 @@ + + + + +Boost.Locale: Class Members - Functions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- u -

+
+ + + diff --git a/doc/html/functions_func_0x76.html b/doc/html/functions_func_0x76.html new file mode 100644 index 0000000..0ee93aa --- /dev/null +++ b/doc/html/functions_func_0x76.html @@ -0,0 +1,116 @@ + + + + +Boost.Locale: Class Members - Functions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- v -

+
+ + + diff --git a/doc/html/functions_func_0x77.html b/doc/html/functions_func_0x77.html new file mode 100644 index 0000000..01b6661 --- /dev/null +++ b/doc/html/functions_func_0x77.html @@ -0,0 +1,117 @@ + + + + +Boost.Locale: Class Members - Functions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + + diff --git a/doc/html/functions_func_0x7e.html b/doc/html/functions_func_0x7e.html new file mode 100644 index 0000000..b3fc6cf --- /dev/null +++ b/doc/html/functions_func_0x7e.html @@ -0,0 +1,119 @@ + + + + +Boost.Locale: Class Members - Functions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- ~ -

+
+ + + diff --git a/doc/html/functions_type.html b/doc/html/functions_type.html new file mode 100644 index 0000000..30fe23b --- /dev/null +++ b/doc/html/functions_type.html @@ -0,0 +1,140 @@ + + + + +Boost.Locale: Class Members - Typedefs + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+ + + diff --git a/doc/html/functions_vars.html b/doc/html/functions_vars.html new file mode 100644 index 0000000..b447cc1 --- /dev/null +++ b/doc/html/functions_vars.html @@ -0,0 +1,144 @@ + + + + +Boost.Locale: Class Members - Variables + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + + diff --git a/doc/html/generator_8hpp_source.html b/doc/html/generator_8hpp_source.html new file mode 100644 index 0000000..027c5d9 --- /dev/null +++ b/doc/html/generator_8hpp_source.html @@ -0,0 +1,205 @@ + + + + +Boost.Locale: boost/locale/generator.hpp Source File + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + diff --git a/doc/html/gettext_for_windows.html b/doc/html/gettext_for_windows.html new file mode 100644 index 0000000..0a8b508 --- /dev/null +++ b/doc/html/gettext_for_windows.html @@ -0,0 +1,128 @@ + + + + +Boost.Locale: Using Gettext Tools on Windows + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Using Gettext Tools on Windows

+
+
+

In order to get the Gettext tools like msgfmt, msgmerge, xgettext for Windows you have basically several options:

+
    +
  • Download the package from CppCMS project (where the Boost.Locale was developed originally)
  • +
  • Download the a set of packages from MinGW project
  • +
  • Build it on your own
  • +
  • Use Cygwin's packages
  • +
+

+Getting gettext utilities from CppCMS project

+

Boost.Locale was developed for needs of CppCMS project and thus CppCMS hosts a convince package for Windows users of pre-build, statically liked gettext runtime utilities like xgettext, msgfmt, etc.

+

So you can download a zip file gettext-tools-static-XXX.zip from a CppCMS downloads page under boost_locale/gettext_for_windows.

+

Extract the file and use the executable files inside.

+

+Getting Gettext via MinGW project

+

MinGW project provides GNU tools for Windows, including GNU compilers and various runtime utilities. Thus you can always install full MinGW distribution including gettext tools. However, if you a want minimalistic runtime version that allows you to extract messages and create catalogs you need to download several packages manually.

+

In order to install Gettext via MinGW distributing you need to download, a GCC's runtime, iconv library and gettext itself.

+

So visit a downloads page of MinGW project and download following files (chose the latest versions of each package):

+
    +
  • From: MinGW/BaseSystem/GCC/Version4/gcc-xxx/
    + File: libgcc-xxx-mingw32-dll-1.tar.lzma
  • +
  • From MinGW/Gettext/gettext-yyy/
    + Files: gettext-yyy-mingw32-dev.tar.lzma, libgettextpo-yyy-mingw32-dll-0.tar.lzma, libintl-yyy-mingw32-dll-8.tar.lzma
  • +
  • From MinGW/libiconv/libiconv-zzz/
    + Files: libiconv-zzz-mingw32-dll-2.tar.lzma, libcharset-zzz-mingw32-dll-1.tar.lzma
  • +
+

For example, at June 23, 2011 it was:

+
    +
  • GNU Runtime: libgcc-4.5.2-1-mingw32-dll-1.tar.lzma
  • +
  • iconv: libiconv-1.13.1-1-mingw32-dll-2.tar.lzma and libcharset-1.13.1-1-mingw32-dll-1.tar.lzma
  • +
  • gettext: libintl-0.17-1-mingw32-dll-8.tar.lzma, libgettextpo-0.17-1-mingw32-dll-0.tar.lzma and gettext-0.17-1-mingw32-dev.tar.lzma.
  • +
+

After you download the packages, extract all the files to the same directory using tools like 7zip and you'll get all the executables and dll's you need under bin subdirectory.

+
Note:
the version on MinGW site is slightly outdated (0.17.1) while gettext provides currently 0.18.1.
+

+Building latest version on your own.

+

You can build your own version of GNU Gettext using MinGW environment, you'll need to have up-to-date gcc compiler and the shell, you'll need to install iconv first and then build a gettext with it.

+

Basic and simplest way would be to open a MinGW shell

+

Build iconv:

+
cd libiconv-SOMEVERSION
+./configure --prefix=c:/mygettext --disable-shared
+make
+make install
+cd ..
+cd gettext-SOMEVERSION
+./configure --prefix=c:/mygettext --disable-shared --with-libiconv-prefix=c:/mygettext
+make
+make install
+

And now you have in c:\mygettext\bin all appropriate executable files to use.

+

+Using Cygwin

+

If you already have Cygwin - just use gettext tools provided with it.

+
+ + + diff --git a/doc/html/glossary.html b/doc/html/glossary.html new file mode 100644 index 0000000..cf0e637 --- /dev/null +++ b/doc/html/glossary.html @@ -0,0 +1,104 @@ + + + + +Boost.Locale: Glossary + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Glossary

+
+
+
    +
  • Basic Multilingual Plane (BMP) -- a part of the Universal Character Set with code points in the range U-0000--U-FFFF. The most commonly used UCS characters lay in this plane, including all Western, Cyrillic, Hebrew, Thai, Arabic and CJK characters. However there are many characters that lay outside the BMP and they are absolutely required for correct support of East Asian languages.
  • +
  • Code Point -- a unique number that represents a "character" in the Universal Character Set. Code points lay in the range of 0-0x10FFFF, and are usually displayed as U+XXXX or U+XXXXXX, where X represents a hexadecimal digit.
  • +
  • Collation -- a sorting order for text, usually alphabetical. It can differ between languages and countries, even for the same characters.
  • +
  • Encoding - a representation of a character set. Some encodings are capable of representing the full UCS range, like UTF-8, and others can only represent a subset of it -- ISO-8859-8 represents only a small subset of about 250 characters of the UCS.
    + Non-Unicode encodings are still very popular, for example the Latin-1 (or ISO-8859-1) encoding covers most of the characters for Western European languages and significantly simplifies the processing of text for applications designed to handle only such languages.
    + For Boost.Locale you should provide an eight-bit (std::string) encoding as part of the locale name, like en_US.UTF-8 or he_IL.cp1255 . UTF-8 is recommended.
  • +
  • Facet - or std::locale::facet -- a base class that every object that describes a specific locale is derived from. Facets can be added to a locale to provide additional culture information.
  • +
  • Formatting - representation of various values according to locale preferences. For example, a number 1234.5 (C representation) should be displayed as 1,234.5 in the US locale and 1.234,5 in the Russian locale. The date November 1st, 2005 would be represented as 11/01/2005 in the United States, and 01.11.2005 in Russia. This is an important part of localization.
    + For example: does "You have to bring 134,230 kg of rice on 04/01/2010" means "134 tons of rice on the first of April" or "134 kg 230 g + of rice on January 4th"? That is quite different.
  • +
  • Gettext - The GNU localization library used for message formatting. Today it is the de-facto standard localization library in the Open Source world. Boost.Locale message formatting is entirely built on Gettext message catalogs.
  • +
  • Locale - a set of parameters that define specific preferences for users in different cultures. It is generally defined by language, country, variants, and encoding, and provides information like: collation order, date-time formatting, message formatting, number formatting and many others. In C++, locale information is represented by the std::locale class.
  • +
  • Message Formatting -- the representation of user interface strings in the user's language. The process of translation of UI strings is generally done using some dictionary provided by the program's translator.
  • +
  • Message Domain -- in gettext terms, the keyword that represents a message catalog. This is usually an application name. When gettext and Boost.Locale search for a specific message catalog, they search in the specified path for a file named after the domain.
  • +
  • Normalization - Unicode normalization is the process of converting strings to a standard form, suitable for text processing and comparison. For example, character "ü" can be represented by a single code point or a combination of the character "u" and the diaeresis "¨". Normalization is an important part of Unicode text processing.
    + Normalization is not locale-dependent, but because it is an important part of Unicode processing, it is included in the Boost.Locale library.
  • +
  • UCS-2 - a fixed-width Unicode encoding, capable of representing only code points in the Basic Multilingual Plane (BMP). It is a legacy encoding and is not recommended for use.
  • +
  • Unicode -- the industry standard that defines the representation and manipulation of text suitable for most languages and countries. It should not be confused with the Universal Character Set, it is a much larger standard that also defines algorithms like bidirectional display order, Arabic shaping, etc.
  • +
  • Universal Character Set (UCS) - an international standard that defines a set of characters for many scripts and their code points.
  • +
  • UTF-8 - a variable-width Unicode transformation format. Each UCS code point is represented as a sequence of between 1 and 4 octets that can be easily distinguished. It includes ASCII as a subset. It is the most popular Unicode encoding for web applications, data transfer and storage, and is the de-facto standard encoding for most POSIX operation systems.
  • +
  • UTF-16 - a variable-width Unicode transformation format. Each UCS code point is represented as a sequence of one or two 16-bit words. It is a very popular encoding for platforms such as the Win32 API, Java, C#, Python, etc. However, it is frequently confused with the _UCS-2_ fixed-width encoding, which can only represent characters in the Basic Multilingual Plane (BMP).
    + This encoding is used for std::wstring under the Win32 platform, where sizeof(wchar_t)==2.
  • +
  • UTF-32/UCS-4 - a fixed-width Unicode transformation format, where each code point is represented as a single 32-bit word. It has the advantage of simple code point representation, but is wasteful in terms of memory usage. It is used for std::wstring encoding for most POSIX platforms, where sizeof(wchar_t)==4.
  • +
  • Case Folding - is a process of converting a text to case independent representation. For example case folding for a word "Grüßen" is "grüssen" - where the letter "ß" is represented in case independent way as "ss".
  • +
  • Title Case - Is a text conversion where the words are capitalized. For example "hello world" is converted to "Hello World"
  • +
+
+ + + diff --git a/doc/html/gnu__gettext_8hpp_source.html b/doc/html/gnu__gettext_8hpp_source.html new file mode 100644 index 0000000..fa5da85 --- /dev/null +++ b/doc/html/gnu__gettext_8hpp_source.html @@ -0,0 +1,197 @@ + + + + +Boost.Locale: boost/locale/gnu_gettext.hpp Source File + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + diff --git a/doc/html/group__boundary.html b/doc/html/group__boundary.html new file mode 100644 index 0000000..fdce483 --- /dev/null +++ b/doc/html/group__boundary.html @@ -0,0 +1,1443 @@ + + + + +Boost.Locale: Boundary Analysis + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

Boundary Analysis

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Classes

class  boost::locale::boundary::boundary_point< IteratorType >
 This class represents a boundary point in the text. More...
struct  boost::locale::boundary::break_info
 This structure is used for representing boundary point that follows the offset. More...
class  boost::locale::boundary::boundary_indexing< Char >
 This facet generates an index for boundary analysis for a given text. More...
class  boost::locale::boundary::segment_index< BaseIterator >
 This class holds an index of segments in the text range and allows to iterate over them. More...
class  boost::locale::boundary::boundary_point_index< BaseIterator >
 This class holds an index of boundary points and allows iterating over them. More...
class  boost::locale::boundary::segment< IteratorType >
 a segment object that represents a pair of two iterators that define the range where this segment exits and a rule that defines it. More...

+Typedefs

typedef std::vector< break_info > boost::locale::boundary::index_type
typedef unspecified_iterator_type boost::locale::boundary::segment_index::iterator
typedef unspecified_iterator_type boost::locale::boundary::segment_index::const_iterator
typedef segment< base_iterator > boost::locale::boundary::segment_index::value_type
typedef unspecified_iterator_type boost::locale::boundary::boundary_point_index::iterator
typedef unspecified_iterator_type boost::locale::boundary::boundary_point_index::const_iterator
typedef boundary_point
+< base_iterator > 
boost::locale::boundary::boundary_point_index::value_type
typedef segment_index
+< std::string::const_iterator > 
boost::locale::boundary::ssegment_index
+typedef segment_index
+< std::wstring::const_iterator > 
boost::locale::boundary::wssegment_index
 convenience typedef
+typedef segment_index
+< std::u16string::const_iterator > 
boost::locale::boundary::u16ssegment_index
 convenience typedef
+typedef segment_index
+< std::u32string::const_iterator > 
boost::locale::boundary::u32ssegment_index
 convenience typedef
+typedef segment_index< char
+const * > 
boost::locale::boundary::csegment_index
 convenience typedef
+typedef segment_index< wchar_t
+const * > 
boost::locale::boundary::wcsegment_index
 convenience typedef
+typedef segment_index
+< char16_t const * > 
boost::locale::boundary::u16csegment_index
 convenience typedef
+typedef segment_index
+< char32_t const * > 
boost::locale::boundary::u32csegment_index
 convenience typedef
+typedef boundary_point_index
+< std::string::const_iterator > 
boost::locale::boundary::sboundary_point_index
 convenience typedef
+typedef boundary_point_index
+< std::wstring::const_iterator > 
boost::locale::boundary::wsboundary_point_index
 convenience typedef
+typedef boundary_point_index
+< std::u16string::const_iterator > 
boost::locale::boundary::u16sboundary_point_index
 convenience typedef
+typedef boundary_point_index
+< std::u32string::const_iterator > 
boost::locale::boundary::u32sboundary_point_index
 convenience typedef
+typedef boundary_point_index
+< char const * > 
boost::locale::boundary::cboundary_point_index
 convenience typedef
+typedef boundary_point_index
+< wchar_t const * > 
boost::locale::boundary::wcboundary_point_index
 convenience typedef
+typedef boundary_point_index
+< char16_t const * > 
boost::locale::boundary::u16cboundary_point_index
 convenience typedef
+typedef boundary_point_index
+< char32_t const * > 
boost::locale::boundary::u32cboundary_point_index
 convenience typedef
+typedef segment
+< std::string::const_iterator > 
boost::locale::boundary::ssegment
 convenience typedef
+typedef segment
+< std::wstring::const_iterator > 
boost::locale::boundary::wssegment
 convenience typedef
+typedef segment
+< std::u16string::const_iterator > 
boost::locale::boundary::u16ssegment
 convenience typedef
+typedef segment
+< std::u32string::const_iterator > 
boost::locale::boundary::u32ssegment
 convenience typedef
+typedef segment< char const * > boost::locale::boundary::csegment
 convenience typedef
+typedef segment< wchar_t const * > boost::locale::boundary::wcsegment
 convenience typedef
+typedef segment< char16_t const * > boost::locale::boundary::u16csegment
 convenience typedef
+typedef segment< char32_t const * > boost::locale::boundary::u32csegment
 convenience typedef
typedef uint32_t boost::locale::boundary::rule_type
 Flags used with word boundary analysis -- the type of the word, line or sentence boundary found.

+Enumerations

enum  boost::locale::boundary::boundary_type { boost::locale::boundary::character, +boost::locale::boundary::word, +boost::locale::boundary::sentence, +boost::locale::boundary::line + }

+Functions

template<typename BaseIterator >
bool boost::locale::boundary::operator== (BaseIterator const &l, boundary_point< BaseIterator > const &r)
template<typename BaseIterator >
bool boost::locale::boundary::operator!= (BaseIterator const &l, boundary_point< BaseIterator > const &r)
 boost::locale::boundary::segment_index::segment_index ()
 boost::locale::boundary::segment_index::segment_index (boundary_type type, base_iterator begin, base_iterator end, rule_type mask, std::locale const &loc=std::locale())
 boost::locale::boundary::segment_index::segment_index (boundary_type type, base_iterator begin, base_iterator end, std::locale const &loc=std::locale())
 boost::locale::boundary::segment_index::segment_index (boundary_point_index< base_iterator > const &)
segment_index const & boost::locale::boundary::segment_index::operator= (boundary_point_index< base_iterator > const &)
void boost::locale::boundary::segment_index::map (boundary_type type, base_iterator begin, base_iterator end, std::locale const &loc=std::locale())
iterator boost::locale::boundary::segment_index::begin () const
iterator boost::locale::boundary::segment_index::end () const
iterator boost::locale::boundary::segment_index::find (base_iterator p) const
rule_type boost::locale::boundary::segment_index::rule () const
void boost::locale::boundary::segment_index::rule (rule_type v)
bool boost::locale::boundary::segment_index::full_select () const
void boost::locale::boundary::segment_index::full_select (bool v)
 boost::locale::boundary::boundary_point_index::boundary_point_index ()
 boost::locale::boundary::boundary_point_index::boundary_point_index (boundary_type type, base_iterator begin, base_iterator end, rule_type mask, std::locale const &loc=std::locale())
 boost::locale::boundary::boundary_point_index::boundary_point_index (boundary_type type, base_iterator begin, base_iterator end, std::locale const &loc=std::locale())
 boost::locale::boundary::boundary_point_index::boundary_point_index (segment_index< base_iterator > const &other)
boundary_point_index const & boost::locale::boundary::boundary_point_index::operator= (segment_index< base_iterator > const &other)
void boost::locale::boundary::boundary_point_index::map (boundary_type type, base_iterator begin, base_iterator end, std::locale const &loc=std::locale())
iterator boost::locale::boundary::boundary_point_index::begin () const
iterator boost::locale::boundary::boundary_point_index::end () const
iterator boost::locale::boundary::boundary_point_index::find (base_iterator p) const
rule_type boost::locale::boundary::boundary_point_index::rule () const
void boost::locale::boundary::boundary_point_index::rule (rule_type v)
+template<typename IteratorL , typename IteratorR >
bool boost::locale::boundary::operator== (segment< IteratorL > const &l, segment< IteratorR > const &r)
 Compare two segments.
+template<typename IteratorL , typename IteratorR >
bool boost::locale::boundary::operator!= (segment< IteratorL > const &l, segment< IteratorR > const &r)
 Compare two segments.
+template<typename IteratorL , typename IteratorR >
bool boost::locale::boundary::operator< (segment< IteratorL > const &l, segment< IteratorR > const &r)
 Compare two segments.
+template<typename IteratorL , typename IteratorR >
bool boost::locale::boundary::operator<= (segment< IteratorL > const &l, segment< IteratorR > const &r)
 Compare two segments.
+template<typename IteratorL , typename IteratorR >
bool boost::locale::boundary::operator> (segment< IteratorL > const &l, segment< IteratorR > const &r)
 Compare two segments.
+template<typename IteratorL , typename IteratorR >
bool boost::locale::boundary::operator>= (segment< IteratorL > const &l, segment< IteratorR > const &r)
 Compare two segments.
+template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool boost::locale::boundary::operator== (std::basic_string< CharType, Traits, Alloc > const &l, segment< IteratorR > const &r)
 Compare string and segment.
+template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool boost::locale::boundary::operator!= (std::basic_string< CharType, Traits, Alloc > const &l, segment< IteratorR > const &r)
 Compare string and segment.
+template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool boost::locale::boundary::operator< (std::basic_string< CharType, Traits, Alloc > const &l, segment< IteratorR > const &r)
 Compare string and segment.
+template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool boost::locale::boundary::operator<= (std::basic_string< CharType, Traits, Alloc > const &l, segment< IteratorR > const &r)
 Compare string and segment.
+template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool boost::locale::boundary::operator> (std::basic_string< CharType, Traits, Alloc > const &l, segment< IteratorR > const &r)
 Compare string and segment.
+template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool boost::locale::boundary::operator>= (std::basic_string< CharType, Traits, Alloc > const &l, segment< IteratorR > const &r)
 Compare string and segment.
+template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool boost::locale::boundary::operator== (segment< Iterator > const &l, std::basic_string< CharType, Traits, Alloc > const &r)
 Compare string and segment.
+template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool boost::locale::boundary::operator!= (segment< Iterator > const &l, std::basic_string< CharType, Traits, Alloc > const &r)
 Compare string and segment.
+template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool boost::locale::boundary::operator< (segment< Iterator > const &l, std::basic_string< CharType, Traits, Alloc > const &r)
 Compare string and segment.
+template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool boost::locale::boundary::operator<= (segment< Iterator > const &l, std::basic_string< CharType, Traits, Alloc > const &r)
 Compare string and segment.
+template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool boost::locale::boundary::operator> (segment< Iterator > const &l, std::basic_string< CharType, Traits, Alloc > const &r)
 Compare string and segment.
+template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool boost::locale::boundary::operator>= (segment< Iterator > const &l, std::basic_string< CharType, Traits, Alloc > const &r)
 Compare string and segment.
+template<typename CharType , typename IteratorR >
bool boost::locale::boundary::operator== (CharType const *l, segment< IteratorR > const &r)
 Compare C string and segment.
+template<typename CharType , typename IteratorR >
bool boost::locale::boundary::operator!= (CharType const *l, segment< IteratorR > const &r)
 Compare C string and segment.
+template<typename CharType , typename IteratorR >
bool boost::locale::boundary::operator< (CharType const *l, segment< IteratorR > const &r)
 Compare C string and segment.
+template<typename CharType , typename IteratorR >
bool boost::locale::boundary::operator<= (CharType const *l, segment< IteratorR > const &r)
 Compare C string and segment.
+template<typename CharType , typename IteratorR >
bool boost::locale::boundary::operator> (CharType const *l, segment< IteratorR > const &r)
 Compare C string and segment.
+template<typename CharType , typename IteratorR >
bool boost::locale::boundary::operator>= (CharType const *l, segment< IteratorR > const &r)
 Compare C string and segment.
+template<typename Iterator , typename CharType >
bool boost::locale::boundary::operator== (segment< Iterator > const &l, CharType const *r)
 Compare C string and segment.
+template<typename Iterator , typename CharType >
bool boost::locale::boundary::operator!= (segment< Iterator > const &l, CharType const *r)
 Compare C string and segment.
+template<typename Iterator , typename CharType >
bool boost::locale::boundary::operator< (segment< Iterator > const &l, CharType const *r)
 Compare C string and segment.
+template<typename Iterator , typename CharType >
bool boost::locale::boundary::operator<= (segment< Iterator > const &l, CharType const *r)
 Compare C string and segment.
+template<typename Iterator , typename CharType >
bool boost::locale::boundary::operator> (segment< Iterator > const &l, CharType const *r)
 Compare C string and segment.
+template<typename Iterator , typename CharType >
bool boost::locale::boundary::operator>= (segment< Iterator > const &l, CharType const *r)
 Compare C string and segment.
template<typename CharType , typename TraitsType , typename Iterator >
std::basic_ostream< CharType,
+TraitsType > & 
boost::locale::boundary::operator<< (std::basic_ostream< CharType, TraitsType > &out, segment< Iterator > const &tok)
rule_type boost::locale::boundary::boundary_rule (boundary_type t)

+Friends

+class boost::locale::boundary::segment_index::boundary_point_index< base_iterator >
+class boost::locale::boundary::boundary_point_index::segment_index< base_iterator >

+Flags that describe a type of word selected

+

+static const rule_type boost::locale::boundary::word_none = 0x0000F
 Not a word, like white space or punctuation mark.
+static const rule_type boost::locale::boundary::word_number = 0x000F0
 Word that appear to be a number.
+static const rule_type boost::locale::boundary::word_letter = 0x00F00
 Word that contains letters, excluding kana and ideographic characters.
+static const rule_type boost::locale::boundary::word_kana = 0x0F000
 Word that contains kana characters.
+static const rule_type boost::locale::boundary::word_ideo = 0xF0000
 Word that contains ideographic characters.
+static const rule_type boost::locale::boundary::word_any = 0xFFFF0
 Any word including numbers, 0 is special flag, equivalent to 15.
+static const rule_type boost::locale::boundary::word_letters = 0xFFF00
 Any word, excluding numbers but including letters, kana and ideograms.
+static const rule_type boost::locale::boundary::word_kana_ideo = 0xFF000
 Word that includes kana or ideographic characters.
static const rule_type boost::locale::boundary::word_mask = 0xFFFFF

+Flags that describe a type of line break

+

+static const rule_type boost::locale::boundary::line_soft = 0x0F
 Soft line break: optional but not required.
+static const rule_type boost::locale::boundary::line_hard = 0xF0
 Hard line break: like break is required (as per CR/LF).
+static const rule_type boost::locale::boundary::line_any = 0xFF
 Soft or Hard line break.
+static const rule_type boost::locale::boundary::line_mask = 0xFF
 Select all types of line breaks.

+Flags that describe a type of sentence break

+

+static const rule_type boost::locale::boundary::sentence_term = 0x0F
 The sentence was terminated with a sentence terminator like ".", "!" possible followed by hard separator like CR, LF, PS.
+static const rule_type boost::locale::boundary::sentence_sep = 0xF0
 The sentence does not contain terminator like ".", "!" but ended with hard separator like CR, LF, PS or end of input.
+static const rule_type boost::locale::boundary::sentence_any = 0xFF
 Either first or second sentence break type;.
+static const rule_type boost::locale::boundary::sentence_mask = 0xFF
 Select all sentence breaking points.

+Flags that describe a type of character break.

At this point break iterator does not distinguish different kinds of characters so it is used for consistency.

+

+static const rule_type boost::locale::boundary::character_any = 0xF
 Not in use, just for consistency.
+static const rule_type boost::locale::boundary::character_mask = 0xF
 Select all character breaking points.
+

Detailed Description

+

This module contains all operations required for boundary analysis of text: character, word, like and sentence boundaries

+

This module contains all operations required for boundary analysis of text: character, word, like and sentence boundaries

+

Typedef Documentation

+ +
+
+
+template<typename BaseIterator>
+ + + + +
typedef unspecified_iterator_type boost::locale::boundary::segment_index< BaseIterator >::const_iterator [inherited]
+
+
+

The bidirectional iterator that iterates over value_type objects.

+
    +
  • The iterators may be invalidated by use of any non-const member function including but not limited to rule(rule_type) and full_select(bool).
  • +
  • The returned value_type object is valid as long as iterator points to it. So this following code is wrong as t used after p was updated:
         segment_index<some_iterator>::iterator p=index.begin();
    +     segment<some_iterator> &t = *p;
    +     ++p;
    +     cout << t.str() << endl;
    +
  • +
+ +
+
+ +
+
+
+template<typename BaseIterator >
+ + + + +
typedef unspecified_iterator_type boost::locale::boundary::boundary_point_index< BaseIterator >::const_iterator [inherited]
+
+
+

The bidirectional iterator that iterates over value_type objects.

+
    +
  • The iterators may be invalidated by use of any non-const member function including but not limited to rule(rule_type) member function.
  • +
  • The returned value_type object is valid as long as iterator points to it. So this following code is wrong as t used after p was updated:
         boundary_point_index<some_iterator>::iterator p=index.begin();
    +     boundary_point<some_iterator> &t = *p;
    +     ++p;
    +     rule_type r = t->rule();
    +
  • +
+ +
+
+ +
+
+ + + + +
typedef std::vector<break_info> boost::locale::boundary::index_type
+
+
+

This type holds the analysis of the text - all its break points with marks

+ +
+
+ +
+
+
+template<typename BaseIterator>
+ + + + +
typedef unspecified_iterator_type boost::locale::boundary::segment_index< BaseIterator >::iterator [inherited]
+
+
+

The bidirectional iterator that iterates over value_type objects.

+
    +
  • The iterators may be invalidated by use of any non-const member function including but not limited to rule(rule_type) and full_select(bool).
  • +
  • The returned value_type object is valid as long as iterator points to it. So this following code is wrong as t used after p was updated:
         segment_index<some_iterator>::iterator p=index.begin();
    +     segment<some_iterator> &t = *p;
    +     ++p;
    +     cout << t.str() << endl;
    +
  • +
+ +
+
+ +
+
+
+template<typename BaseIterator >
+ + + + +
typedef unspecified_iterator_type boost::locale::boundary::boundary_point_index< BaseIterator >::iterator [inherited]
+
+
+

The bidirectional iterator that iterates over value_type objects.

+
    +
  • The iterators may be invalidated by use of any non-const member function including but not limited to rule(rule_type) member function.
  • +
  • The returned value_type object is valid as long as iterator points to it. So this following code is wrong as t used after p was updated:
         boundary_point_index<some_iterator>::iterator p=index.begin();
    +     boundary_point<some_iterator> &t = *p;
    +     ++p;
    +     rule_type r = t->rule();
    +
  • +
+ +
+
+ +
+
+ + + + +
typedef uint32_t boost::locale::boundary::rule_type
+
+
+ +

Flags used with word boundary analysis -- the type of the word, line or sentence boundary found.

+

It is a bit-mask that represents various combinations of rules used to select this specific boundary.

+ +
+
+ +
+
+ + + + +
typedef segment_index<std::string::const_iterator> boost::locale::boundary::ssegment_index
+
+
+

convenience typedef

+ +
+
+ +
+
+
+template<typename BaseIterator>
+ + + + +
typedef segment<base_iterator> boost::locale::boundary::segment_index< BaseIterator >::value_type [inherited]
+
+
+

The type dereferenced by the iterator and const_iterator. It is an object that represents selected segment.

+ +
+
+ +
+
+
+template<typename BaseIterator >
+ + + + +
typedef boundary_point<base_iterator> boost::locale::boundary::boundary_point_index< BaseIterator >::value_type [inherited]
+
+
+

The type dereferenced by the iterator and const_iterator. It is an object that represents the selected boundary point.

+ +
+
+

Enumeration Type Documentation

+ +
+ +
+

This type describes a possible boundary analysis alternatives.

+
Enumerator:
+ + + + +
character  +

Analyse the text for character boundaries.

+
word  +

Analyse the text for word boundaries.

+
sentence  +

Analyse the text for Find sentence boundaries.

+
line  +

Analyse the text for positions suitable for line breaks.

+
+
+
+ +
+
+

Function Documentation

+ +
+
+
+template<typename BaseIterator>
+ + + + + + + + +
iterator boost::locale::boundary::segment_index< BaseIterator >::begin ( )  const [inline, inherited]
+
+
+

Get the iterator on the beginning of the segments range.

+

Preconditions: the segment_index should have a mapping

+
Note:
+

The returned iterator is invalidated by access to any non-const member functions of this object

+ +
+
+ +
+
+
+template<typename BaseIterator >
+ + + + + + + + +
iterator boost::locale::boundary::boundary_point_index< BaseIterator >::begin ( )  const [inline, inherited]
+
+
+

Get the iterator on the beginning of the boundary points range.

+

Preconditions: this boundary_point_index should have a mapping

+
Note:
+

The returned iterator is invalidated by access to any non-const member functions of this object

+ +
+
+ +
+
+
+template<typename BaseIterator >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
boost::locale::boundary::boundary_point_index< BaseIterator >::boundary_point_index (boundary_type  type,
base_iterator  begin,
base_iterator  end,
rule_type  mask,
std::locale const &  loc = std::locale() 
) [inline, inherited]
+
+
+

Create a segment_index for boundary analysis type of the text in range [begin,end) using a rule mask for locale loc.

+ +
+
+ +
+
+
+template<typename BaseIterator >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
boost::locale::boundary::boundary_point_index< BaseIterator >::boundary_point_index (boundary_type  type,
base_iterator  begin,
base_iterator  end,
std::locale const &  loc = std::locale() 
) [inline, inherited]
+
+
+

Create a segment_index for boundary analysis type of the text in range [begin,end) selecting all possible boundary points (full mask) for locale loc.

+ +
+
+ +
+
+
+template<typename BaseIterator >
+ + + + + + + + + +
boost::locale::boundary::boundary_point_index< BaseIterator >::boundary_point_index (segment_index< base_iterator > const &  other )  [inherited]
+
+
+

Create a boundary_point_index from a segment_index. It copies all indexing information and uses the default rule (all possible boundary points)

+

This operation is very cheap, so if you use boundary_point_index and segment_index on same text range it is much better to create one from another rather then indexing the same range twice.

+
Note:
rule() flags are not copied
+ +
+
+ +
+
+
+template<typename BaseIterator >
+ + + + + + + + +
boost::locale::boundary::boundary_point_index< BaseIterator >::boundary_point_index ( )  [inline, inherited]
+
+
+

Default constructor.

+
Note:
+

When this object is constructed by default it does not include a valid index, thus calling begin(), end() or find() member functions would lead to undefined behavior

+ +
+
+ +
+
+ + + + + + + + + +
rule_type boost::locale::boundary::boundary_rule (boundary_type  t )  [inline]
+
+
+

This function returns the mask that covers all variants for specific boundary type

+ +
+
+ +
+
+
+template<typename BaseIterator>
+ + + + + + + + +
iterator boost::locale::boundary::segment_index< BaseIterator >::end ( )  const [inline, inherited]
+
+
+

Get the iterator on the ending of the segments range.

+

Preconditions: the segment_index should have a mapping

+

The returned iterator is invalidated by access to any non-const member functions of this object

+ +
+
+ +
+
+
+template<typename BaseIterator >
+ + + + + + + + +
iterator boost::locale::boundary::boundary_point_index< BaseIterator >::end ( )  const [inline, inherited]
+
+
+

Get the iterator on the ending of the boundary points range.

+

Preconditions: this boundary_point_index should have a mapping

+
Note:
+

The returned iterator is invalidated by access to any non-const member functions of this object

+ +
+
+ +
+
+
+template<typename BaseIterator>
+ + + + + + + + + +
iterator boost::locale::boundary::segment_index< BaseIterator >::find (base_iterator  p )  const [inline, inherited]
+
+
+

Find a first valid segment following a position p.

+

If p is inside a valid segment this segment is selected:

+

For example: For word boundary analysis with word_any rule():

+
    +
  • "to| be or ", would point to "be",
  • +
  • "t|o be or ", would point to "to",
  • +
  • "to be or| ", would point to end.
  • +
+

Preconditions: the segment_index should have a mapping and p should be valid iterator to the text in the mapped range.

+

The returned iterator is invalidated by access to any non-const member functions of this object

+ +
+
+ +
+
+
+template<typename BaseIterator >
+ + + + + + + + + +
iterator boost::locale::boundary::boundary_point_index< BaseIterator >::find (base_iterator  p )  const [inline, inherited]
+
+
+

Find a first valid boundary point on a position p or following it.

+

For example: For word boundary analysis of the text "to be or"

+
    +
  • "|to be", would return boundary point at "|to be",
  • +
  • "t|o be", would point to "to| be"
  • +
+

Preconditions: the boundary_point_index should have a mapping and p should be valid iterator to the text in the mapped range.

+

The returned iterator is invalidated by access to any non-const member functions of this object

+ +
+
+ +
+
+
+template<typename BaseIterator>
+ + + + + + + + +
bool boost::locale::boundary::segment_index< BaseIterator >::full_select ( )  const [inline, inherited]
+
+
+

Get the full_select property value - should segment include in the range values that not belong to specific rule() or not.

+

The default value is false.

+

For example for sentence boundary with rule sentence_term the segments of text "Hello! How\nare you?" are "Hello!\", "are you?" when full_select() is false because "How\n" is selected as sentence by a rule spits the text by line feed. If full_select() is true the returned segments are "Hello! ", "How\nare you?" where "How\n" is joined with the following part "are you?"

+ +
+
+ +
+
+
+template<typename BaseIterator>
+ + + + + + + + + +
void boost::locale::boundary::segment_index< BaseIterator >::full_select (bool  v )  [inline, inherited]
+
+
+

Set the full_select property value - should segment include in the range values that not belong to specific rule() or not.

+

The default value is false.

+

For example for sentence boundary with rule sentence_term the segments of text "Hello! How\nare you?" are "Hello!\", "are you?" when full_select() is false because "How\n" is selected as sentence by a rule spits the text by line feed. If full_select() is true the returned segments are "Hello! ", "How\nare you?" where "How\n" is joined with the following part "are you?"

+ +
+
+ +
+
+
+template<typename BaseIterator >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void boost::locale::boundary::boundary_point_index< BaseIterator >::map (boundary_type  type,
base_iterator  begin,
base_iterator  end,
std::locale const &  loc = std::locale() 
) [inline, inherited]
+
+
+

Create a new index for boundary analysis type of the text in range [begin,end) for locale loc.

+
Note:
rule() remains unchanged.
+ +
+
+ +
+
+
+template<typename BaseIterator>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void boost::locale::boundary::segment_index< BaseIterator >::map (boundary_type  type,
base_iterator  begin,
base_iterator  end,
std::locale const &  loc = std::locale() 
) [inline, inherited]
+
+
+

Create a new index for boundary analysis type of the text in range [begin,end) for locale loc.

+
Note:
rule() and full_select() remain unchanged.
+ +
+
+ +
+
+
+template<typename BaseIterator >
+ + + + + + + + + + + + + + + + + + +
bool boost::locale::boundary::operator!= (BaseIterator const &  l,
boundary_point< BaseIterator > const &  r 
)
+
+
+

Check if the boundary point r points to different location from an iterator l

+ +
+
+ +
+
+
+template<typename CharType , typename TraitsType , typename Iterator >
+ + + + + + + + + + + + + + + + + + +
std::basic_ostream<CharType,TraitsType>& boost::locale::boundary::operator<< (std::basic_ostream< CharType, TraitsType > &  out,
segment< Iterator > const &  tok 
)
+
+
+

Write the segment to the stream character by character

+ +
+
+ +
+
+
+template<typename BaseIterator >
+ + + + + + + + + +
boundary_point_index const& boost::locale::boundary::boundary_point_index< BaseIterator >::operator= (segment_index< base_iterator > const &  other )  [inherited]
+
+
+

Copy a boundary_point_index from a segment_index. It copies all indexing information and keeps the current rule() unchanged

+

This operation is very cheap, so if you use boundary_point_index and segment_index on same text range it is much better to create one from another rather then indexing the same range twice.

+
Note:
rule() flags are not copied
+ +
+
+ +
+
+
+template<typename BaseIterator>
+ + + + + + + + + +
segment_index const& boost::locale::boundary::segment_index< BaseIterator >::operator= (boundary_point_index< base_iterator > const &  )  [inherited]
+
+
+

Copy an index from a boundary_point_index. It copies all indexing information and uses the default rule (all possible segments)

+

This operation is very cheap, so if you use boundary_point_index and segment_index on same text range it is much better to create one from another rather then indexing the same range twice.

+
Note:
rule() flags are not copied
+ +
+
+ +
+
+
+template<typename BaseIterator >
+ + + + + + + + + + + + + + + + + + +
bool boost::locale::boundary::operator== (BaseIterator const &  l,
boundary_point< BaseIterator > const &  r 
)
+
+
+

Check if the boundary point r points to same location as an iterator l

+ +
+
+ +
+
+
+template<typename BaseIterator>
+ + + + + + + + +
rule_type boost::locale::boundary::segment_index< BaseIterator >::rule ( )  const [inline, inherited]
+
+
+

Get the mask of rules that are used

+ +
+
+ +
+
+
+template<typename BaseIterator >
+ + + + + + + + + +
void boost::locale::boundary::boundary_point_index< BaseIterator >::rule (rule_type  v )  [inline, inherited]
+
+
+

Set the mask of rules that are used

+ +
+
+ +
+
+
+template<typename BaseIterator >
+ + + + + + + + +
rule_type boost::locale::boundary::boundary_point_index< BaseIterator >::rule ( )  const [inline, inherited]
+
+
+

Get the mask of rules that are used

+ +
+
+ +
+
+
+template<typename BaseIterator>
+ + + + + + + + + +
void boost::locale::boundary::segment_index< BaseIterator >::rule (rule_type  v )  [inline, inherited]
+
+
+

Set the mask of rules that are used

+ +
+
+ +
+
+
+template<typename BaseIterator>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
boost::locale::boundary::segment_index< BaseIterator >::segment_index (boundary_type  type,
base_iterator  begin,
base_iterator  end,
std::locale const &  loc = std::locale() 
) [inline, inherited]
+
+
+

Create a segment_index for boundary analysis type of the text in range [begin,end) selecting all possible segments (full mask) for locale loc.

+ +
+
+ +
+
+
+template<typename BaseIterator>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
boost::locale::boundary::segment_index< BaseIterator >::segment_index (boundary_type  type,
base_iterator  begin,
base_iterator  end,
rule_type  mask,
std::locale const &  loc = std::locale() 
) [inline, inherited]
+
+
+

Create a segment_index for boundary analysis type of the text in range [begin,end) using a rule mask for locale loc.

+ +
+
+ +
+
+
+template<typename BaseIterator>
+ + + + + + + + +
boost::locale::boundary::segment_index< BaseIterator >::segment_index ( )  [inline, inherited]
+
+
+

Default constructor.

+
Note:
+

When this object is constructed by default it does not include a valid index, thus calling begin(), end() or find() member functions would lead to undefined behavior

+ +
+
+ +
+
+
+template<typename BaseIterator>
+ + + + + + + + + +
boost::locale::boundary::segment_index< BaseIterator >::segment_index (boundary_point_index< base_iterator > const &  )  [inherited]
+
+
+

Create a segment_index from a boundary_point_index. It copies all indexing information and used default rule (all possible segments)

+

This operation is very cheap, so if you use boundary_point_index and segment_index on same text range it is much better to create one from another rather then indexing the same range twice.

+
Note:
rule() flags are not copied
+ +
+
+

Variable Documentation

+ +
+
+ + + + +
const rule_type boost::locale::boundary::word_mask = 0xFFFFF [static]
+
+
+

Full word mask - select all possible variants

+ +
+
+
+ + + diff --git a/doc/html/group__codepage.html b/doc/html/group__codepage.html new file mode 100644 index 0000000..b83e960 --- /dev/null +++ b/doc/html/group__codepage.html @@ -0,0 +1,837 @@ + + + + +Boost.Locale: Character conversion functions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

Character conversion functions

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Classes

class  boost::locale::conv::conversion_error
 The excepton that is thrown in case of conversion error. More...
class  boost::locale::conv::invalid_charset_error
 This exception is thrown in case of use of unsupported or invalid character set. More...

+Enumerations

enum  boost::locale::conv::method_type { boost::locale::conv::skip = 0, +boost::locale::conv::stop = 1, +boost::locale::conv::default_method = skip + }

+Functions

template<typename CharType >
std::basic_string< CharType > boost::locale::conv::to_utf (char const *begin, char const *end, std::string const &charset, method_type how=default_method)
template<typename CharType >
std::string boost::locale::conv::from_utf (CharType const *begin, CharType const *end, std::string const &charset, method_type how=default_method)
template<typename CharType >
std::basic_string< CharType > boost::locale::conv::to_utf (char const *begin, char const *end, std::locale const &loc, method_type how=default_method)
template<typename CharType >
std::string boost::locale::conv::from_utf (CharType const *begin, CharType const *end, std::locale const &loc, method_type how=default_method)
template<typename CharType >
std::basic_string< CharType > boost::locale::conv::to_utf (std::string const &text, std::string const &charset, method_type how=default_method)
template<typename CharType >
std::string boost::locale::conv::from_utf (std::basic_string< CharType > const &text, std::string const &charset, method_type how=default_method)
template<typename CharType >
std::basic_string< CharType > boost::locale::conv::to_utf (char const *text, std::string const &charset, method_type how=default_method)
template<typename CharType >
std::string boost::locale::conv::from_utf (CharType const *text, std::string const &charset, method_type how=default_method)
template<typename CharType >
std::basic_string< CharType > boost::locale::conv::to_utf (std::string const &text, std::locale const &loc, method_type how=default_method)
template<typename CharType >
std::string boost::locale::conv::from_utf (std::basic_string< CharType > const &text, std::locale const &loc, method_type how=default_method)
template<typename CharType >
std::basic_string< CharType > boost::locale::conv::to_utf (char const *text, std::locale const &loc, method_type how=default_method)
template<typename CharType >
std::string boost::locale::conv::from_utf (CharType const *text, std::locale const &loc, method_type how=default_method)
std::string boost::locale::conv::between (char const *begin, char const *end, std::string const &to_encoding, std::string const &from_encoding, method_type how=default_method)
std::string boost::locale::conv::between (char const *text, std::string const &to_encoding, std::string const &from_encoding, method_type how=default_method)
std::string boost::locale::conv::between (std::string const &text, std::string const &to_encoding, std::string const &from_encoding, method_type how=default_method)
template<typename CharOut , typename CharIn >
std::basic_string< CharOut > boost::locale::conv::utf_to_utf (CharIn const *begin, CharIn const *end, method_type how=default_method)
template<typename CharOut , typename CharIn >
std::basic_string< CharOut > boost::locale::conv::utf_to_utf (CharIn const *str, method_type how=default_method)
template<typename CharOut , typename CharIn >
std::basic_string< CharOut > boost::locale::conv::utf_to_utf (std::basic_string< CharIn > const &str, method_type how=default_method)
+

Enumeration Type Documentation

+ +
+ +
+

enum that defines conversion policy

+
Enumerator:
+ + + +
skip  +

Skip illegal/unconvertable characters.

+
stop  +

Stop conversion and throw conversion_error.

+
default_method  +

Default method - skip.

+
+
+
+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
std::string boost::locale::conv::between (char const *  begin,
char const *  end,
std::string const &  to_encoding,
std::string const &  from_encoding,
method_type  how = default_method 
)
+
+
+

Convert a text in range [begin,end) to to_encoding from from_encoding

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
std::string boost::locale::conv::between (char const *  text,
std::string const &  to_encoding,
std::string const &  from_encoding,
method_type  how = default_method 
) [inline]
+
+
+

Convert a text to to_encoding from from_encoding

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
std::string boost::locale::conv::between (std::string const &  text,
std::string const &  to_encoding,
std::string const &  from_encoding,
method_type  how = default_method 
) [inline]
+
+
+

Convert a text to to_encoding from from_encoding

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
std::string boost::locale::conv::from_utf (CharType const *  begin,
CharType const *  end,
std::locale const &  loc,
method_type  how = default_method 
)
+
+
+

convert UTF text in range [begin,end) to a text encoded according to locale loc according to policy how

+
Note:
throws std::bad_cast if the loc does not have info facet installed
+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::string boost::locale::conv::from_utf (CharType const *  text,
std::string const &  charset,
method_type  how = default_method 
)
+
+
+

Convert a text from UTF to charset

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::string boost::locale::conv::from_utf (std::basic_string< CharType > const &  text,
std::locale const &  loc,
method_type  how = default_method 
)
+
+
+

Convert a text in UTF to locale encoding given by loc

+
Note:
throws std::bad_cast if the loc does not have info facet installed
+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::string boost::locale::conv::from_utf (std::basic_string< CharType > const &  text,
std::string const &  charset,
method_type  how = default_method 
)
+
+
+

Convert a text from charset to UTF string

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::string boost::locale::conv::from_utf (CharType const *  text,
std::locale const &  loc,
method_type  how = default_method 
)
+
+
+

Convert a text in UTF to locale encoding given by loc

+
Note:
throws std::bad_cast if the loc does not have info facet installed
+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
std::string boost::locale::conv::from_utf (CharType const *  begin,
CharType const *  end,
std::string const &  charset,
method_type  how = default_method 
)
+
+
+

convert UTF text in range [begin,end) to a text encoded with charset according to policy how

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::conv::to_utf (char const *  text,
std::string const &  charset,
method_type  how = default_method 
)
+
+
+

Convert a text from charset to UTF string

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::conv::to_utf (char const *  begin,
char const *  end,
std::string const &  charset,
method_type  how = default_method 
)
+
+
+

convert string to UTF string from text in range [begin,end) encoded with charset according to policy how

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::conv::to_utf (std::string const &  text,
std::locale const &  loc,
method_type  how = default_method 
)
+
+
+

Convert a text in locale encoding given by loc to UTF

+
Note:
throws std::bad_cast if the loc does not have info facet installed
+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::conv::to_utf (std::string const &  text,
std::string const &  charset,
method_type  how = default_method 
)
+
+
+

convert a string text encoded with charset to UTF string

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::conv::to_utf (char const *  begin,
char const *  end,
std::locale const &  loc,
method_type  how = default_method 
)
+
+
+

convert string to UTF string from text in range [begin,end) encoded according to locale loc according to policy how

+
Note:
throws std::bad_cast if the loc does not have info facet installed
+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::conv::to_utf (char const *  text,
std::locale const &  loc,
method_type  how = default_method 
)
+
+
+

Convert a text in locale encoding given by loc to UTF

+
Note:
throws std::bad_cast if the loc does not have info facet installed
+ +
+
+ +
+
+
+template<typename CharOut , typename CharIn >
+ + + + + + + + + + + + + + + + + + +
std::basic_string<CharOut> boost::locale::conv::utf_to_utf (std::basic_string< CharIn > const &  str,
method_type  how = default_method 
)
+
+
+

Convert a Unicode string str other Unicode encoding

+ +
+
+ +
+
+
+template<typename CharOut , typename CharIn >
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::basic_string<CharOut> boost::locale::conv::utf_to_utf (CharIn const *  begin,
CharIn const *  end,
method_type  how = default_method 
)
+
+
+

Convert a Unicode text in range [begin,end) to other Unicode encoding

+ +
+
+ +
+
+
+template<typename CharOut , typename CharIn >
+ + + + + + + + + + + + + + + + + + +
std::basic_string<CharOut> boost::locale::conv::utf_to_utf (CharIn const *  str,
method_type  how = default_method 
)
+
+
+

Convert a Unicode NUL terminated string str other Unicode encoding

+ +
+
+
+ + + diff --git a/doc/html/group__collation.html b/doc/html/group__collation.html new file mode 100644 index 0000000..0756f9b --- /dev/null +++ b/doc/html/group__collation.html @@ -0,0 +1,85 @@ + + + + +Boost.Locale: Collation + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

Collation

+
+
+ + + + + + + + +

+Classes

class  boost::locale::collator_base
 a base class that includes collation level flags More...
class  boost::locale::collator< CharType >
 Collation facet. More...
struct  boost::locale::comparator< CharType, default_level >
 This class can be used in STL algorithms and containers for comparison of strings with a level other than primary. More...
+

Detailed Description

+

This module introduces collation related classes

+
+ + + diff --git a/doc/html/group__convert.html b/doc/html/group__convert.html new file mode 100644 index 0000000..02d346e --- /dev/null +++ b/doc/html/group__convert.html @@ -0,0 +1,683 @@ + + + + +Boost.Locale: Text Conversions + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

Text Conversions

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Classes

class  boost::locale::converter_base
 This class provides base flags for text manipulation. It is used as base for converter facet. More...
class  boost::locale::converter< Char >
 The facet that implements text manipulation. More...

+Enumerations

enum  boost::locale::norm_type {
+  boost::locale::norm_nfd, +boost::locale::norm_nfc, +boost::locale::norm_nfkd, +boost::locale::norm_nfkc, +
+  boost::locale::norm_default = norm_nfc +
+ }

+Functions

template<typename CharType >
std::basic_string< CharType > boost::locale::normalize (std::basic_string< CharType > const &str, norm_type n=norm_default, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > boost::locale::normalize (CharType const *str, norm_type n=norm_default, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > boost::locale::normalize (CharType const *begin, CharType const *end, norm_type n=norm_default, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > boost::locale::to_upper (std::basic_string< CharType > const &str, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > boost::locale::to_upper (CharType const *str, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > boost::locale::to_upper (CharType const *begin, CharType const *end, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > boost::locale::to_lower (std::basic_string< CharType > const &str, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > boost::locale::to_lower (CharType const *str, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > boost::locale::to_lower (CharType const *begin, CharType const *end, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > boost::locale::to_title (std::basic_string< CharType > const &str, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > boost::locale::to_title (CharType const *str, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > boost::locale::to_title (CharType const *begin, CharType const *end, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > boost::locale::fold_case (std::basic_string< CharType > const &str, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > boost::locale::fold_case (CharType const *str, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > boost::locale::fold_case (CharType const *begin, CharType const *end, std::locale const &loc=std::locale())
+

Detailed Description

+

This module provides various function for string manipulation like Unicode normalization, case conversion etc.

+

Enumeration Type Documentation

+ +
+
+ + + + +
enum boost::locale::norm_type
+
+
+

The type that defined normalization form

+
Enumerator:
+ + + + + +
norm_nfd  +

Canonical decomposition.

+
norm_nfc  +

Canonical decomposition followed by canonical composition.

+
norm_nfkd  +

Compatibility decomposition.

+
norm_nfkc  +

Compatibility decomposition followed by canonical composition.

+
norm_default  +

Default normalization - canonical decomposition followed by canonical composition.

+
+
+
+ +
+
+

Function Documentation

+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::fold_case (std::basic_string< CharType > const &  str,
std::locale const &  loc = std::locale() 
)
+
+
+

Fold case of a string str according to locale loc

+
Note:
throws std::bad_cast if loc does not have converter facet installed
+
Examples:
hello.cpp, and whello.cpp.
+
+
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::fold_case (CharType const *  str,
std::locale const &  loc = std::locale() 
)
+
+
+

Fold case of a NUL terminated string str according to locale loc

+
Note:
throws std::bad_cast if loc does not have converter facet installed
+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::fold_case (CharType const *  begin,
CharType const *  end,
std::locale const &  loc = std::locale() 
)
+
+
+

Fold case of a string in range [begin,end) according to locale loc

+
Note:
throws std::bad_cast if loc does not have converter facet installed
+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::normalize (CharType const *  str,
norm_type  n = norm_default,
std::locale const &  loc = std::locale() 
)
+
+
+

Normalize NUL terminated Unicode string str according to normalization form n

+

Note: This function receives only Unicode strings, i.e.: UTF-8, UTF-16 or UTF-32. It does not take in account the locale encoding, because Unicode decomposition and composition are meaningless outside of a Unicode character set.

+
Note:
throws std::bad_cast if loc does not have converter facet installed
+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::normalize (CharType const *  begin,
CharType const *  end,
norm_type  n = norm_default,
std::locale const &  loc = std::locale() 
)
+
+
+

Normalize Unicode string in range [begin,end) according to normalization form n

+

Note: This function receives only Unicode strings, i.e.: UTF-8, UTF-16 or UTF-32. It does not take in account the locale encoding, because Unicode decomposition and composition are meaningless outside of a Unicode character set.

+
Note:
throws std::bad_cast if loc does not have converter facet installed
+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::normalize (std::basic_string< CharType > const &  str,
norm_type  n = norm_default,
std::locale const &  loc = std::locale() 
)
+
+
+

Normalize Unicode string str according to normalization form n

+

Note: This function receives only Unicode strings, i.e.: UTF-8, UTF-16 or UTF-32. It does not take in account the locale encoding, because Unicode decomposition and composition are meaningless outside of a Unicode character set.

+
Note:
throws std::bad_cast if loc does not have converter facet installed
+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::to_lower (CharType const *  str,
std::locale const &  loc = std::locale() 
)
+
+
+

Convert a NUL terminated string str to lower case according to locale loc

+
Note:
throws std::bad_cast if loc does not have converter facet installed
+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::to_lower (CharType const *  begin,
CharType const *  end,
std::locale const &  loc = std::locale() 
)
+
+
+

Convert a string in range [begin,end) to lower case according to locale loc

+
Note:
throws std::bad_cast if loc does not have converter facet installed
+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::to_lower (std::basic_string< CharType > const &  str,
std::locale const &  loc = std::locale() 
)
+
+
+

Convert a string str to lower case according to locale loc

+
Note:
throws std::bad_cast if loc does not have converter facet installed
+
Examples:
conversions.cpp, hello.cpp, wconversions.cpp, and whello.cpp.
+
+
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::to_title (CharType const *  begin,
CharType const *  end,
std::locale const &  loc = std::locale() 
)
+
+
+

Convert a string in range [begin,end) to title case according to locale loc

+
Note:
throws std::bad_cast if loc does not have converter facet installed
+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::to_title (std::basic_string< CharType > const &  str,
std::locale const &  loc = std::locale() 
)
+
+
+

Convert a string str to title case according to locale loc

+
Note:
throws std::bad_cast if loc does not have converter facet installed
+
Examples:
hello.cpp, and whello.cpp.
+
+
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::to_title (CharType const *  str,
std::locale const &  loc = std::locale() 
)
+
+
+

Convert a NUL terminated string str to title case according to locale loc

+
Note:
throws std::bad_cast if loc does not have converter facet installed
+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::to_upper (CharType const *  str,
std::locale const &  loc = std::locale() 
)
+
+
+

Convert a NUL terminated string str to upper case according to locale loc

+
Note:
throws std::bad_cast if loc does not have converter facet installed
+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::to_upper (CharType const *  begin,
CharType const *  end,
std::locale const &  loc = std::locale() 
)
+
+
+

Convert a string in range [begin,end) to upper case according to locale loc

+
Note:
throws std::bad_cast if loc does not have converter facet installed
+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::to_upper (std::basic_string< CharType > const &  str,
std::locale const &  loc = std::locale() 
)
+
+
+

Convert a string str to upper case according to locale loc

+
Note:
throws std::bad_cast if loc does not have converter facet installed
+
Examples:
conversions.cpp, hello.cpp, wconversions.cpp, and whello.cpp.
+
+
+
+
+ + + diff --git a/doc/html/group__date__time.html b/doc/html/group__date__time.html new file mode 100644 index 0000000..9276e1f --- /dev/null +++ b/doc/html/group__date__time.html @@ -0,0 +1,265 @@ + + + + +Boost.Locale: Date, Time, Timezone and Calendar manipulations + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

Date, Time, Timezone and Calendar manipulations

+
+
+ + + + + + + + + + + + + + + + + +

+

+ + +

+

+ + + + + + + + +

+Classes

class  boost::locale::date_time_error
 This error is thrown in case of invalid state that occurred. More...
struct  boost::locale::date_time_period
 This class represents a pair of period_type and the integer values that describes its amount. For example 3 days or 4 years. More...
class  boost::locale::date_time_period_set
 this class that represents a set of periods, More...
class  boost::locale::calendar
 this class provides an access to general calendar information. More...
class  boost::locale::date_time
 this class represents a date time and allows to perform various operation according to the locale settings. More...
class  boost::locale::date_time_duration
 This class represents a period: a pair of two date_time objects. More...

+Namespaces

namespace  boost::locale::period
 

Namespace that contains various types for manipulation with dates.

+
namespace  boost::locale::time_zone
 

namespace that holds functions for operating with global time zone

+

+Functions

date_time_period_set boost::locale::operator+ (date_time_period_set const &a, date_time_period_set const &b)
date_time_period_set boost::locale::operator- (date_time_period_set const &a, date_time_period_set const &b)
template<typename CharType >
std::basic_ostream< CharType > & boost::locale::operator<< (std::basic_ostream< CharType > &out, date_time const &t)
template<typename CharType >
std::basic_istream< CharType > & boost::locale::operator>> (std::basic_istream< CharType > &in, date_time &t)
date_time_duration boost::locale::operator- (date_time const &later, date_time const &earlier)
+

Detailed Description

+

This module provides various calendar, timezone and date time services

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
date_time_period_set boost::locale::operator+ (date_time_period_set const &  a,
date_time_period_set const &  b 
) [inline]
+
+
+

Append two periods sets. Note this operator is not commutative

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
date_time_duration boost::locale::operator- (date_time const &  later,
date_time const &  earlier 
) [inline]
+
+
+

Calculates the difference between two dates, the left operand is a later point on time line. Returns date_time_duration object.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
date_time_period_set boost::locale::operator- (date_time_period_set const &  a,
date_time_period_set const &  b 
) [inline]
+
+
+

Append two period sets when all periods of set change their sign

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + +
std::basic_ostream<CharType>& boost::locale::operator<< (std::basic_ostream< CharType > &  out,
date_time const &  t 
)
+
+
+

Writes date_time t to output stream out.

+

This function uses locale, calendar and time zone of the target stream in.

+

For example:

+
  date_time now(time(0),hebrew_calendar)
+  cout << "Year: " << period::year(now) <<" Full Date:"<< now;
+

The output may be Year:5770 Full Date:Jan 1, 2010

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + +
std::basic_istream<CharType>& boost::locale::operator>> (std::basic_istream< CharType > &  in,
date_time &  t 
)
+
+
+

Reads date_time t from output stream in

+

This function uses locale, calendar and time zone of the source stream in.

+ +
+
+
+ + + diff --git a/doc/html/group__format.html b/doc/html/group__format.html new file mode 100644 index 0000000..49f3f09 --- /dev/null +++ b/doc/html/group__format.html @@ -0,0 +1,184 @@ + + + + +Boost.Locale: Format + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

Format

+
+
+ + + + + + + + + + + + +

+Classes

class  boost::locale::basic_format< CharType >
 a printf like class that allows type-safe and locale aware message formatting More...

+Typedefs

typedef basic_format< char > boost::locale::format
typedef basic_format< wchar_t > boost::locale::wformat
typedef basic_format< char16_t > boost::locale::u16format
typedef basic_format< char32_t > boost::locale::u32format

+Functions

template<typename CharType >
std::basic_ostream< CharType > & boost::locale::operator<< (std::basic_ostream< CharType > &out, basic_format< CharType > const &fmt)
+

Detailed Description

+

This module provides printf like functionality integrated into iostreams and suitable for localization

+

Typedef Documentation

+ +
+
+ + + + +
typedef basic_format<char> boost::locale::format
+
+
+

Definition of char based format

+
Examples:
calendar.cpp, and hello.cpp.
+
+
+
+ +
+
+ + + + +
typedef basic_format<char16_t> boost::locale::u16format
+
+
+

Definition of char16_t based format

+ +
+
+ +
+
+ + + + +
typedef basic_format<char32_t> boost::locale::u32format
+
+
+

Definition of char32_t based format

+ +
+
+ +
+
+ + + + +
typedef basic_format<wchar_t> boost::locale::wformat
+
+
+

Definition of wchar_t based format

+
Examples:
whello.cpp.
+
+
+
+

Function Documentation

+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + +
std::basic_ostream<CharType>& boost::locale::operator<< (std::basic_ostream< CharType > &  out,
basic_format< CharType > const &  fmt 
)
+
+
+

Write formatted message to stream.

+

This operator actually causes actual text formatting. It uses the locale of out stream

+ +
+
+
+ + + diff --git a/doc/html/group__manipulators.html b/doc/html/group__manipulators.html new file mode 100644 index 0000000..943f5ae --- /dev/null +++ b/doc/html/group__manipulators.html @@ -0,0 +1,719 @@ + + + + +Boost.Locale: I/O Stream manipulators + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

I/O Stream manipulators

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

std::ios_base & boost::locale::as::posix (std::ios_base &ios)
std::ios_base & boost::locale::as::number (std::ios_base &ios)
std::ios_base & boost::locale::as::currency (std::ios_base &ios)
std::ios_base & boost::locale::as::percent (std::ios_base &ios)
std::ios_base & boost::locale::as::date (std::ios_base &ios)
std::ios_base & boost::locale::as::time (std::ios_base &ios)
std::ios_base & boost::locale::as::datetime (std::ios_base &ios)
std::ios_base & boost::locale::as::strftime (std::ios_base &ios)
std::ios_base & boost::locale::as::spellout (std::ios_base &ios)
std::ios_base & boost::locale::as::ordinal (std::ios_base &ios)
std::ios_base & boost::locale::as::currency_default (std::ios_base &ios)
std::ios_base & boost::locale::as::currency_iso (std::ios_base &ios)
std::ios_base & boost::locale::as::currency_national (std::ios_base &ios)
std::ios_base & boost::locale::as::time_default (std::ios_base &ios)
std::ios_base & boost::locale::as::time_short (std::ios_base &ios)
std::ios_base & boost::locale::as::time_medium (std::ios_base &ios)
std::ios_base & boost::locale::as::time_long (std::ios_base &ios)
std::ios_base & boost::locale::as::time_full (std::ios_base &ios)
std::ios_base & boost::locale::as::date_default (std::ios_base &ios)
std::ios_base & boost::locale::as::date_short (std::ios_base &ios)
std::ios_base & boost::locale::as::date_medium (std::ios_base &ios)
std::ios_base & boost::locale::as::date_long (std::ios_base &ios)
std::ios_base & boost::locale::as::date_full (std::ios_base &ios)
template<typename CharType >
unspecified_type boost::locale::as::ftime (std::basic_string< CharType > const &format)
template<typename CharType >
unspecified_type boost::locale::as::ftime (CharType const *format)
std::ios_base & boost::locale::as::gmt (std::ios_base &ios)
std::ios_base & boost::locale::as::local_time (std::ios_base &ios)
unspecified_type boost::locale::as::time_zone (char const *id)
unspecified_type boost::locale::as::time_zone (std::string const &id)
unspecified_type boost::locale::as::domain (std::string const &id)
+

Function Documentation

+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::currency (std::ios_base &  ios )  [inline]
+
+
+

Format currency, number is treated like amount of money

+
Examples:
hello.cpp, and whello.cpp.
+
+
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::currency_default (std::ios_base &  ios )  [inline]
+
+
+

Set default currency formatting style -- national, like "$"

+ +
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::currency_iso (std::ios_base &  ios )  [inline]
+
+
+

Set ISO currency formatting style, like "USD", (requires ICU >= 4.2)

+ +
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::currency_national (std::ios_base &  ios )  [inline]
+
+
+

Set national currency formatting style, like "$"

+ +
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::date (std::ios_base &  ios )  [inline]
+
+
+

Format a date, number is treated as POSIX time

+
Examples:
hello.cpp, and whello.cpp.
+
+
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::date_default (std::ios_base &  ios )  [inline]
+
+
+

set default (medium) date formatting style

+ +
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::date_full (std::ios_base &  ios )  [inline]
+
+
+

set full date formatting style

+ +
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::date_long (std::ios_base &  ios )  [inline]
+
+
+

set long date formatting style

+ +
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::date_medium (std::ios_base &  ios )  [inline]
+
+
+

set medium date formatting style

+ +
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::date_short (std::ios_base &  ios )  [inline]
+
+
+

set short date formatting style

+ +
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::datetime (std::ios_base &  ios )  [inline]
+
+
+

Format a date and time, number is treated as POSIX time

+ +
+
+ +
+
+ + + + + + + + + +
unspecified_type boost::locale::as::domain (std::string const &  id )  [inline]
+
+
+

Manipulator for switching message domain in ostream,

+
Note:
The returned object throws std::bad_cast if the I/O stream does not have message_format facet installed
+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + +
unspecified_type boost::locale::as::ftime (std::basic_string< CharType > const &  format ) 
+
+
+

Set strftime like formatting string

+

Please note, formatting flags are very similar but not exactly the same as flags for C function strftime. Differences: some flags as "%e" do not add blanks to fill text up to two spaces, not all flags supported.

+

Flags:

+
    +
  • "%a" -- Abbreviated weekday (Sun.)
  • +
  • "%A" -- Full weekday (Sunday)
  • +
  • "%b" -- Abbreviated month (Jan.)
  • +
  • "%B" -- Full month (January)
  • +
  • "%c" -- Locale date-time format. **Note:** prefer using "as::datetime"
  • +
  • "%d" -- Day of Month [01,31]
  • +
  • "%e" -- Day of Month [1,31]
  • +
  • "%h" -- Same as "%b"
  • +
  • "%H" -- 24 clock hour [00,23]
  • +
  • "%I" -- 12 clock hour [01,12]
  • +
  • "%j" -- Day of year [1,366]
  • +
  • "%m" -- Month [01,12]
  • +
  • "%M" -- Minute [00,59]
  • +
  • "%n" -- New Line
  • +
  • "%p" -- AM/PM in locale representation
  • +
  • "%r" -- Time with AM/PM, same as "%I:%M:%S %p"
  • +
  • "%R" -- Same as "%H:%M"
  • +
  • "%S" -- Second [00,61]
  • +
  • "%t" -- Tab character
  • +
  • "%T" -- Same as "%H:%M:%S"
  • +
  • "%x" -- Local date representation. **Note:** prefer using "as::date"
  • +
  • "%X" -- Local time representation. **Note:** prefer using "as::time"
  • +
  • "%y" -- Year [00,99]
  • +
  • "%Y" -- 4 digits year. (2009)
  • +
  • "%Z" -- Time Zone
  • +
  • "%%" -- Percent symbol
  • +
+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + +
unspecified_type boost::locale::as::ftime (CharType const *  format ) 
+
+
+

See ftime(std::basic_string<CharType> const &format)

+ +
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::gmt (std::ios_base &  ios )  [inline]
+
+
+

Set GMT time zone to stream

+ +
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::local_time (std::ios_base &  ios )  [inline]
+
+
+

Set local time zone to stream

+ +
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::number (std::ios_base &  ios )  [inline]
+
+
+

Format a number. Note, unlike standard number formatting, integers would be treated like real numbers when std::fixed or std::scientific manipulators were applied

+
Examples:
hello.cpp, and whello.cpp.
+
+
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::ordinal (std::ios_base &  ios )  [inline]
+
+
+

Write an order of the number like 4th.

+ +
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::percent (std::ios_base &  ios )  [inline]
+
+
+

Format percent, value 0.3 is treated as 30%.

+ +
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::posix (std::ios_base &  ios )  [inline]
+
+
+

Format values with "POSIX" or "C" locale. Note, if locale was created with additional non-classic locale then These numbers may be localized

+ +
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::spellout (std::ios_base &  ios )  [inline]
+
+
+

Spell the number, like "one hundred and ten"

+ +
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::strftime (std::ios_base &  ios )  [inline]
+
+
+

Create formatted date time, Please note, this manipulator only changes formatting mode, and not format itself, so you are probably looking for ftime manipulator

+ +
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::time (std::ios_base &  ios )  [inline]
+
+
+

Format a time, number is treated as POSIX time

+
Examples:
hello.cpp, and whello.cpp.
+
+
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::time_default (std::ios_base &  ios )  [inline]
+
+
+

set default (medium) time formatting style

+ +
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::time_full (std::ios_base &  ios )  [inline]
+
+
+

set full time formatting style

+ +
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::time_long (std::ios_base &  ios )  [inline]
+
+
+

set long time formatting style

+ +
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::time_medium (std::ios_base &  ios )  [inline]
+
+
+

set medium time formatting style

+ +
+
+ +
+
+ + + + + + + + + +
std::ios_base& boost::locale::as::time_short (std::ios_base &  ios )  [inline]
+
+
+

set short time formatting style

+ +
+
+ +
+
+ + + + + + + + + +
unspecified_type boost::locale::as::time_zone (std::string const &  id )  [inline]
+
+
+

Set time zone using id

+ +
+
+ +
+
+ + + + + + + + + +
unspecified_type boost::locale::as::time_zone (char const *  id )  [inline]
+
+
+

Set time zone using id

+ +
+
+
+ + + diff --git a/doc/html/group__message.html b/doc/html/group__message.html new file mode 100644 index 0000000..0b3c3bb --- /dev/null +++ b/doc/html/group__message.html @@ -0,0 +1,1301 @@ + + + + +Boost.Locale: Message Formatting (translation) + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

Message Formatting (translation)

+
+
+ + + + + + + + + +

+

+ + +

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Classes

class  boost::locale::message_format< CharType >
 This facet provides message formatting abilities. More...
class  boost::locale::basic_message< CharType >
 This class represents a message that can be converted to a specific locale message. More...

+Namespaces

namespace  boost::locale::gnu_gettext
 

This namespace holds classes that provide GNU Gettext message catalogs support.

+
namespace  boost::locale::as
 

This namespace includes all manipulators that can be used on IO streams.

+

+Typedefs

typedef std::basic_string
+< CharType > 
boost::locale::message_format::string_type
+typedef std::basic_string
+< char_type > 
boost::locale::basic_message::string_type
 The string type this object can be used with.
+typedef message_format< char_type > boost::locale::basic_message::facet_type
 The type of the facet the messages are fetched with.
typedef basic_message< char > boost::locale::message
typedef basic_message< wchar_t > boost::locale::wmessage
typedef basic_message< char16_t > boost::locale::u16message
typedef basic_message< char32_t > boost::locale::u32message

+Functions

 boost::locale::message_format::message_format (size_t refs=0)
virtual char_type const * boost::locale::message_format::get (int domain_id, char_type const *context, char_type const *id) const =0
virtual char_type const * boost::locale::message_format::get (int domain_id, char_type const *context, char_type const *single_id, int n) const =0
virtual int boost::locale::message_format::domain (std::string const &domain) const =0
virtual char_type const * boost::locale::message_format::convert (char_type const *msg, string_type &buffer) const =0
 boost::locale::basic_message::basic_message ()
 boost::locale::basic_message::basic_message (char_type const *id)
 boost::locale::basic_message::basic_message (char_type const *single, char_type const *plural, int n)
 boost::locale::basic_message::basic_message (char_type const *context, char_type const *id)
 boost::locale::basic_message::basic_message (char_type const *context, char_type const *single, char_type const *plural, int n)
 boost::locale::basic_message::basic_message (string_type const &id)
 boost::locale::basic_message::basic_message (string_type const &single, string_type const &plural, int number)
 boost::locale::basic_message::basic_message (string_type const &context, string_type const &id)
 boost::locale::basic_message::basic_message (string_type const &context, string_type const &single, string_type const &plural, int number)
 boost::locale::basic_message::basic_message (basic_message const &other)
basic_message const & boost::locale::basic_message::operator= (basic_message const &other)
void boost::locale::basic_message::swap (basic_message &other)
 boost::locale::basic_message::operator string_type () const
string_type boost::locale::basic_message::str () const
string_type boost::locale::basic_message::str (std::locale const &locale) const
string_type boost::locale::basic_message::str (std::locale const &locale, std::string const &domain_id) const
string_type boost::locale::basic_message::str (std::string const &domain_id) const
string_type boost::locale::basic_message::str (std::locale const &loc, int id) const
void boost::locale::basic_message::write (std::basic_ostream< char_type > &out) const
template<typename CharType >
std::basic_ostream< CharType > & boost::locale::operator<< (std::basic_ostream< CharType > &out, basic_message< CharType > const &msg)

+Indirect message translation function family

+

+template<typename CharType >
basic_message< CharType > boost::locale::translate (CharType const *msg)
 Translate a message, msg is not copied.
+template<typename CharType >
basic_message< CharType > boost::locale::translate (CharType const *context, CharType const *msg)
 Translate a message in context, msg and context are not copied.
+template<typename CharType >
basic_message< CharType > boost::locale::translate (CharType const *single, CharType const *plural, int n)
 Translate a plural message form, single and plural are not copied.
+template<typename CharType >
basic_message< CharType > boost::locale::translate (CharType const *context, CharType const *single, CharType const *plural, int n)
 Translate a plural message from in constext, context, single and plural are not copied.
+template<typename CharType >
basic_message< CharType > boost::locale::translate (std::basic_string< CharType > const &msg)
 Translate a message, msg is copied.
+template<typename CharType >
basic_message< CharType > boost::locale::translate (std::basic_string< CharType > const &context, std::basic_string< CharType > const &msg)
 Translate a message in context,context and msg is copied.
+template<typename CharType >
basic_message< CharType > boost::locale::translate (std::basic_string< CharType > const &context, std::basic_string< CharType > const &single, std::basic_string< CharType > const &plural, int n)
 Translate a plural message form in constext, context, single and plural are copied.
+template<typename CharType >
basic_message< CharType > boost::locale::translate (std::basic_string< CharType > const &single, std::basic_string< CharType > const &plural, int n)
 Translate a plural message form, single and plural are copied.

+Direct message translation functions family

+

template<typename CharType >
std::basic_string< CharType > boost::locale::gettext (CharType const *id, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > boost::locale::ngettext (CharType const *s, CharType const *p, int n, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > boost::locale::dgettext (char const *domain, CharType const *id, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > boost::locale::dngettext (char const *domain, CharType const *s, CharType const *p, int n, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > boost::locale::pgettext (CharType const *context, CharType const *id, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > boost::locale::npgettext (CharType const *context, CharType const *s, CharType const *p, int n, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > boost::locale::dpgettext (char const *domain, CharType const *context, CharType const *id, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > boost::locale::dnpgettext (char const *domain, CharType const *context, CharType const *s, CharType const *p, int n, std::locale const &loc=std::locale())
+

Detailed Description

+

This module provides message translation functionality, i.e. allow your application to speak native language

+

Typedef Documentation

+ +
+
+ + + + +
typedef basic_message<char> boost::locale::message
+
+
+

Convenience typedef for char

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + +
typedef std::basic_string<CharType> boost::locale::message_format< CharType >::string_type [inherited]
+
+
+

String type

+ +
+
+ +
+
+ + + + +
typedef basic_message<char16_t> boost::locale::u16message
+
+
+

Convenience typedef for char16_t

+ +
+
+ +
+
+ + + + +
typedef basic_message<char32_t> boost::locale::u32message
+
+
+

Convenience typedef for char32_t

+ +
+
+ +
+
+ + + + +
typedef basic_message<wchar_t> boost::locale::wmessage
+
+
+

Convenience typedef for wchar_t

+ +
+
+

Function Documentation

+ +
+
+
+template<typename CharType>
+ + + + + + + + +
boost::locale::basic_message< CharType >::basic_message ( )  [inline, inherited]
+
+
+

Create default empty message

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + + +
boost::locale::basic_message< CharType >::basic_message (char_type const *  id )  [inline, explicit, inherited]
+
+
+

Create a simple message from 0 terminated string. The string should exist until the message is destroyed. Generally useful with static constant strings

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + + + + + + + + + + + + + + + + + +
boost::locale::basic_message< CharType >::basic_message (char_type const *  single,
char_type const *  plural,
int  n 
) [inline, explicit, inherited]
+
+
+

Create a simple plural form message from 0 terminated strings. The strings should exist until the message is destroyed. Generally useful with static constant strings.

+

n is the number, single and plural are singular and plural forms of the message

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + + +
boost::locale::basic_message< CharType >::basic_message (basic_message< CharType > const &  other )  [inline, inherited]
+
+
+

Copy an object

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + + + + + + + + + + + +
boost::locale::basic_message< CharType >::basic_message (char_type const *  context,
char_type const *  id 
) [inline, explicit, inherited]
+
+
+

Create a simple message from 0 terminated strings, with context information. The string should exist until the message is destroyed. Generally useful with static constant strings

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
boost::locale::basic_message< CharType >::basic_message (char_type const *  context,
char_type const *  single,
char_type const *  plural,
int  n 
) [inline, explicit, inherited]
+
+
+

Create a simple plural form message from 0 terminated strings, with context. The strings should exist until the message is destroyed. Generally useful with static constant strings.

+

n is the number, single and plural are singular and plural forms of the message

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + + +
boost::locale::basic_message< CharType >::basic_message (string_type const &  id )  [inline, explicit, inherited]
+
+
+

Create a simple message from a string.

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + + + + + + + + + + + + + + + + + +
boost::locale::basic_message< CharType >::basic_message (string_type const &  single,
string_type const &  plural,
int  number 
) [inline, explicit, inherited]
+
+
+

Create a simple plural form message from strings.

+

n is the number, single and plural are single and plural forms of the message

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + + + + + + + + + + + +
boost::locale::basic_message< CharType >::basic_message (string_type const &  context,
string_type const &  id 
) [inline, explicit, inherited]
+
+
+

Create a simple message from a string with context.

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
boost::locale::basic_message< CharType >::basic_message (string_type const &  context,
string_type const &  single,
string_type const &  plural,
int  number 
) [inline, explicit, inherited]
+
+
+

Create a simple plural form message from strings.

+

n is the number, single and plural are single and plural forms of the message

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + + + + + + + + + + + +
virtual char_type const* boost::locale::message_format< CharType >::convert (char_type const *  msg,
string_type buffer 
) const [pure virtual, inherited]
+
+
+

Convert the string msg to target locale's encoding. If msg is already in target encoding it would be returned otherwise the converted string is stored in temporary buffer and buffer.c_str() is returned.

+

Note: for char_type that is char16_t, char32_t and wchar_t it is no-op, returns msg

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::dgettext (char const *  domain,
CharType const *  id,
std::locale const &  loc = std::locale() 
)
+
+
+

Translate message id according to locale loc in domain domain

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::dngettext (char const *  domain,
CharType const *  s,
CharType const *  p,
int  n,
std::locale const &  loc = std::locale() 
)
+
+
+

Translate plural form according to locale loc in domain domain

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::dnpgettext (char const *  domain,
CharType const *  context,
CharType const *  s,
CharType const *  p,
int  n,
std::locale const &  loc = std::locale() 
)
+
+
+

Translate plural form according to locale loc in domain domain in context context

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + + +
virtual int boost::locale::message_format< CharType >::domain (std::string const &  domain )  const [pure virtual, inherited]
+
+
+

Convert a string that defines domain to the integer id used by get functions

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::dpgettext (char const *  domain,
CharType const *  context,
CharType const *  id,
std::locale const &  loc = std::locale() 
)
+
+
+

Translate message id according to locale loc in domain domain in context context

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + + + + + + + + + + + + + + + + + +
virtual char_type const* boost::locale::message_format< CharType >::get (int  domain_id,
char_type const *  context,
char_type const *  id 
) const [pure virtual, inherited]
+
+
+

This function returns a pointer to the string for a message defined by a context and identification string id. Both create a single key for message lookup in a domain defined by domain_id.

+

If context is NULL it is not considered to be a part of the key

+

If a translated string is found, it is returned, otherwise NULL is returned

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
virtual char_type const* boost::locale::message_format< CharType >::get (int  domain_id,
char_type const *  context,
char_type const *  single_id,
int  n 
) const [pure virtual, inherited]
+
+
+

This function returns a pointer to the string for a plural message defined by a context and identification string single_id.

+

If context is NULL it is not considered to be a part of the key

+

Both create a single key for message lookup in a domain defined domain_id. n is used to pick the correct translation string for a specific number.

+

If a translated string is found, it is returned, otherwise NULL is returned

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::gettext (CharType const *  id,
std::locale const &  loc = std::locale() 
)
+
+
+

Translate message id according to locale loc

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + + +
boost::locale::message_format< CharType >::message_format (size_t  refs = 0 )  [inline, inherited]
+
+
+

Default constructor

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::ngettext (CharType const *  s,
CharType const *  p,
int  n,
std::locale const &  loc = std::locale() 
)
+
+
+

Translate plural form according to locale loc

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::npgettext (CharType const *  context,
CharType const *  s,
CharType const *  p,
int  n,
std::locale const &  loc = std::locale() 
)
+
+
+

Translate plural form according to locale loc in context context

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + +
boost::locale::basic_message< CharType >::operator string_type ( )  const [inline, inherited]
+
+
+

Message class can be explicitly converted to string class

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + +
std::basic_ostream<CharType>& boost::locale::operator<< (std::basic_ostream< CharType > &  out,
basic_message< CharType > const &  msg 
)
+
+
+

Translate message msg and write it to stream

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + + +
basic_message const& boost::locale::basic_message< CharType >::operator= (basic_message< CharType > const &  other )  [inline, inherited]
+
+
+

Assign other message object to this one

+ +
+
+ +
+
+
+template<typename CharType >
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::basic_string<CharType> boost::locale::pgettext (CharType const *  context,
CharType const *  id,
std::locale const &  loc = std::locale() 
)
+
+
+

Translate message id according to locale loc in context context

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + + +
string_type boost::locale::basic_message< CharType >::str (std::string const &  domain_id )  const [inline, inherited]
+
+
+

Translate message to a string using the default locale and message domain domain_id

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + +
string_type boost::locale::basic_message< CharType >::str ( )  const [inline, inherited]
+
+
+

Translate message to a string in the default global locale, using default domain

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + + + + + + + + + + + +
string_type boost::locale::basic_message< CharType >::str (std::locale const &  locale,
std::string const &  domain_id 
) const [inline, inherited]
+
+
+

Translate message to a string using locale locale and message domain domain_id

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + + + + + + + + + + + +
string_type boost::locale::basic_message< CharType >::str (std::locale const &  loc,
int  id 
) const [inline, inherited]
+
+
+

Translate message to a string using locale loc and message domain index id

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + + +
string_type boost::locale::basic_message< CharType >::str (std::locale const &  locale )  const [inline, inherited]
+
+
+

Translate message to a string in the locale locale, using default domain

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + + +
void boost::locale::basic_message< CharType >::swap (basic_message< CharType > &  other )  [inline, inherited]
+
+
+

Swap two message objects

+ +
+
+ +
+
+
+template<typename CharType>
+ + + + + + + + + +
void boost::locale::basic_message< CharType >::write (std::basic_ostream< char_type > &  out )  const [inline, inherited]
+
+
+

Translate message and write to stream out, using imbued locale and domain set to the stream

+ +
+
+
+ + + diff --git a/doc/html/hello_8cpp-example.html b/doc/html/hello_8cpp-example.html new file mode 100644 index 0000000..e737da1 --- /dev/null +++ b/doc/html/hello_8cpp-example.html @@ -0,0 +1,114 @@ + + + + +Boost.Locale: hello.cpp + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

hello.cpp

+
+
+

Basic example of using various functions provided by this library

+
//
+//  Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
+//
+//  Distributed under the Boost Software License, Version 1.0. (See
+//  accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+//
+#include <boost/locale.hpp>
+#include <iostream>
+
+#include <ctime>
+
+int main()
+{
+    using namespace boost::locale;
+    using namespace std;
+    generator gen;
+    locale loc=gen(""); 
+    // Create system default locale
+
+    locale::global(loc); 
+    // Make it system global
+    
+    cout.imbue(loc);
+    // Set as default locale for output
+    
+    cout <<format("Today {1,date} at {1,time} we had run our first localization example") % time(0) 
+          <<endl;
+   
+    cout<<"This is how we show numbers in this locale "<<as::number << 103.34 <<endl; 
+    cout<<"This is how we show currency in this locale "<<as::currency << 103.34 <<endl; 
+    cout<<"This is typical date in the locale "<<as::date << std::time(0) <<endl;
+    cout<<"This is typical time in the locale "<<as::time << std::time(0) <<endl;
+    cout<<"This is upper case "<<to_upper("Hello World!")<<endl;
+    cout<<"This is lower case "<<to_lower("Hello World!")<<endl;
+    cout<<"This is title case "<<to_title("Hello World!")<<endl;
+    cout<<"This is fold case "<<fold_case("Hello World!")<<endl;
+   
+}
+
+// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
+
+
+ + + diff --git a/doc/html/hierarchy.html b/doc/html/hierarchy.html new file mode 100644 index 0000000..2eb6f1b --- /dev/null +++ b/doc/html/hierarchy.html @@ -0,0 +1,119 @@ + + + + +Boost.Locale: Hierarchical Index + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Class Hierarchy

+
+ + + + diff --git a/doc/html/hold__ptr_8hpp_source.html b/doc/html/hold__ptr_8hpp_source.html new file mode 100644 index 0000000..2ae495b --- /dev/null +++ b/doc/html/hold__ptr_8hpp_source.html @@ -0,0 +1,131 @@ + + + + +Boost.Locale: boost/locale/hold_ptr.hpp Source File + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + diff --git a/doc/html/index.html b/doc/html/index.html new file mode 100644 index 0000000..7e47ca3 --- /dev/null +++ b/doc/html/index.html @@ -0,0 +1,16 @@ + + + + +Boost.Locale + + + + + + <body> + <a href="main.html">Frames are disabled. Click here to go to the main page.</a> + </body> + + + diff --git a/doc/html/index_8hpp_source.html b/doc/html/index_8hpp_source.html new file mode 100644 index 0000000..70444c8 --- /dev/null +++ b/doc/html/index_8hpp_source.html @@ -0,0 +1,877 @@ + + + + +Boost.Locale: boost/locale/boundary/index.hpp Source File + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + diff --git a/doc/html/info_8hpp_source.html b/doc/html/info_8hpp_source.html new file mode 100644 index 0000000..266720e --- /dev/null +++ b/doc/html/info_8hpp_source.html @@ -0,0 +1,163 @@ + + + + +Boost.Locale: boost/locale/info.hpp Source File + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + diff --git a/doc/html/locale_gen.html b/doc/html/locale_gen.html new file mode 100644 index 0000000..56bcf13 --- /dev/null +++ b/doc/html/locale_gen.html @@ -0,0 +1,132 @@ + + + + +Boost.Locale: Locale Generation + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Locale Generation

+
+
+

Each locale is defined by a specific locale identifier, which contains a mandatory part (Language) and several optional parts (Country, Variant, keywords and character encoding of std::string). Boost.Locale uses the POSIX naming convention for locales, i.e. a locale is defined as language[_COUNTRY][.encoding][@variant], where lang is ISO-639 language name like "en" or "ru", COUNTRY is the ISO-3166 country identifier like "US" or "DE", encoding is the eight-bit character encoding like UTF-8 or ISO-8859-1, and variant is additional options for specializing the locale, like euro or calendar=hebrew, see Variant.

+

Note that each locale should include the encoding in order to handle char based strings correctly.

+

+Basics

+

The class generator provides tools to generate the locales we need. The simplest way to use generator is to create a locale and set it as the global one:

+
    #include <boost/locale.hpp>
+    
+    using namespace boost::locale;
+    int main()
+    {
+        generator gen;
+        // Create locale generator 
+        std::locale::global(gen("")); 
+        // "" - the system default locale, set
+        // it globally
+    }
+

Of course we can also specify the locale manually

+
    std::locale loc = gen("en_US.UTF-8"); 
+    // Use English, United States locale
+
Note:
+
    +
  • Even if your application uses wide strings everywhere, you should specify the 8-bit encoding to use for 8-bit stream IO operations like cout or fstream.
    +
  • +
  • The default locale is defined by the environment variables LC_CTYPE , LC_ALL , and LANG in that order (i.e. LC_CTYPE first and LANG last). On Windows, the library also queries the LOCALE_USER_DEFAULT option in the Win32 API when these variables are not set.
  • +
+

Tip: Prefer using UTF-8 Unicode encoding over 8-bit encodings like the ISO-8859-X ones.

+

By default the generated locales include all supported categories and character types. However, if your application uses only 8-bit encodings, only wide-character encodings, or only specific facets, you can limit the facet generation to specific categories and character types by calling the categories and characters member functions of the generator class.

+

For example:

+
    generator gen;
+    gen.characters(wchar_t_facet);
+    gen.categories(collation_facet | formatting_facet);
+    std::locale::global(gen("de_DE.UTF-8"));
+

+Variant

+

The variant part of the locale (the part that comes after @ symbol) is localization back-end dependent.

+

+Non ICU Backends

+

POSIX and std back-ends use their own OS specific naming conventions and depend on the current OS configuration. For example typical Linux distribution provides euro for currency selection, cyrillic and latin for specification of language script.

+

winapi back-end does not support any variants.

+

+ICU Backend

+

ICU provides wide range of locale variant options. For detailed instructions read this ICU manual pages.

+

However in general it is represented as set of key=value pairs separated with a semicolon ";" For example: "@collation=phonebook;calendar=islamic-civil".

+

Currently ICU supports following keys:

+
    +
  • calendar - the calendar used for the current locale. For example: gregorian, japanese, buddhist, islamic, hebrew, chinese, islamic-civil.
  • +
  • collation - the collation order used for this locales, for example phonebook, pinyin, traditional, stroke, direct, posix.
  • +
  • currency - the currency used in this locale, the standard 3 letter code like USD or JPY.
  • +
  • numbers - the numbering system used, for example: latn, arab, thai.
  • +
+

Please refer to CLDR and ICU documentation for exact list of keys and values:

+ +
+ + + diff --git a/doc/html/locale_information.html b/doc/html/locale_information.html new file mode 100644 index 0000000..90f1a1a --- /dev/null +++ b/doc/html/locale_information.html @@ -0,0 +1,89 @@ + + + + +Boost.Locale: Getting information about the current locale + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Getting information about the current locale

+
+
+

The std::locale::name function provides very limited information about a locale. Such a name is platform- and compiler-dependent, and is useless for Boost.Locale. There is no way to change it, so for all locales created by Boost.Locale, name() returns the same value as name() for std::locale::classic().

+

Thus an additional facet was created, giving more precise information: boost::locale::info. It has the following member functions:

+ +

For example:

+
    cout << "The language code is " << std::use_facet<boost::locale::info>(some_locale).language() << endl;
+
+ + + diff --git a/doc/html/localization__backend_8hpp_source.html b/doc/html/localization__backend_8hpp_source.html new file mode 100644 index 0000000..d4dbdf9 --- /dev/null +++ b/doc/html/localization__backend_8hpp_source.html @@ -0,0 +1,161 @@ + + + + +Boost.Locale: boost/locale/localization_backend.hpp Source File + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + diff --git a/doc/html/localized_text_formatting.html b/doc/html/localized_text_formatting.html new file mode 100644 index 0000000..ee577a4 --- /dev/null +++ b/doc/html/localized_text_formatting.html @@ -0,0 +1,176 @@ + + + + +Boost.Locale: Localized Text Formatting + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Localized Text Formatting

+
+
+

The iostream manipulators are very useful, but when we create a messages for the user, sometimes we need something like good old printf or boost::format.

+

Unfortunately boost::format has several limitations in context of localization:

+
    +
  1. It renders all parameters using global locale rather than target ostream locale. For example:
    +
        std::locale::global(std::locale("en_US.UTF-8"));
    +    output.imbue(std::locale("de_DE.UTF-8"))
    +    output << boost::format("%1%") % 1234.345;
    +

    + This would write "1,234.235" to output, instead of the "1.234,234" that is expected for "de_DE" locale
  2. +
  3. It knows nothing about the new Boost.Locale manipulators.
  4. +
  5. The printf-like syntax is very limited for formatting complex localized data, not allowing the formatting of dates, times, or currencies
  6. +
+

Thus a new class, boost::locale::format, was introduced. For example:

+
    wcout << wformat(L"Today {1,date} I would meet {2} at home") % time(0) % name <<endl;
+

Each format specifier is enclosed within {} brackets, is separated with a comma "," and may have an additional option after an equals symbol '='. This option may be simple ASCII text or single-quoted localized text. If a single-quote should be inserted within the text, it may be represented with a pair of single-quote characters.

+

Here is an example of a format string:

+
+    "Ms. {1} had arrived at {2,ftime='%I o''clock'} at home. The exact time is {2,time=full}"
+

The syntax is described by following grammar:

+
+    format : '{' parameters '}'
+    parameters: parameter | parameter ',' parameters;
+    parameter : key ["=" value] ;
+    key : [0-9a-zA-Z<>]+ ;
+    value : ascii-string-excluding-"}"-and="," | local-string ; 
+    local-string : quoted-text | quoted-text local-string;
+    quoted-text : '[^']*' ;
+

You can include literal '{' and '}' by inserting double "{{" or "}}" to the text.

+
cout << format(translate("Unexpected `{{' in line {1} in file {2}")) % pos % file;
+

Would display something like

+
+Unexpected `{' in line 5 in file source.cpp
+

The following format key-value pairs are supported:

+
    +
  • [0-9]+ -- digits, the index of the formatted parameter -- required.
  • +
  • num or number -- format a number. Options are:
    +
      +
    • hex -- display in hexadecimal format
    • +
    • oct -- display in octal format
    • +
    • sci or scientific -- display in scientific format
    • +
    • fix or fixed -- display in fixed format
      + For example, number=sci
    • +
    +
  • +
  • cur or currency -- format currency. Options are:
    +
      +
    • iso -- display using ISO currency symbol.
    • +
    • nat or national -- display using national currency symbol.
      +
    • +
    +
  • +
  • per or percent -- format a percentage value.
  • +
  • date, time, datetime or dt -- format a date, a time, or a date and time. Options are:
    +
      +
    • s or short -- display in short format.
    • +
    • m or medium -- display in medium format.
    • +
    • l or long -- display in long format.
    • +
    • f or full -- display in full format.
    • +
    +
  • +
  • ftime with string (quoted) parameter -- display as with strftime. See as::ftime manipulator.
  • +
  • spell or spellout -- spell the number.
  • +
  • ord or ordinal -- format an ordinal number (1st, 2nd... etc)
  • +
  • left or < -- align-left.
  • +
  • right or > -- align-right.
  • +
  • width or w -- set field width (requires parameter).
  • +
  • precision or p -- set precision (requires parameter).
  • +
  • locale -- with parameter -- switch locales for the current operation. This command generates a locale with formatting facets, giving more fine grained control of formatting. For example:
    +
        cout << format("This article was published at {1,date=l} (Gregorian) {1,locale=he_IL@calendar=hebrew,date=l} (Hebrew)") % date;
    +
  • +
  • timezone or tz -- the name of the timezone to display the time in. For example:
    +
        cout << format("Time is: Local {1,time}, ({1,time,tz=EET} Eastern European Time)") % date;
    +
  • +
  • local - display the time in local time
  • +
  • gmt - display the time in UTC time scale
        cout << format("Local time is: {1,time,local}, universal time is {1,time,gmt}") % time;
    +
  • +
+

The constructor for the format class can take an object of type message, simplifying integration with message translation code.

+

For example:

+
    cout<< format(translate("Adding {1} to {2}, we get {3}")) % a % b % (a+b) << endl;
+

A formatted string can be fetched directly by using the str(std::locale const &loc=std::locale()) member function. For example:

+
    std::wstring de = (wformat(translate("Adding {1} to {2}, we get {3}")) % a % b % (a+b)).str(de_locale);
+    std::wstring fr = (wformat(translate("Adding {1} to {2}, we get {3}")) % a % b % (a+b)).str(fr_locale);
+
Note:
There is one significant difference between boost::format and boost::locale::format: Boost.Locale's format converts its parameters only when written to an ostream or when the `str()` member function is called. It only saves references to the objects that can be written to a stream.
+

This is generally not a problem when all operations are done in one statement, such as:

+
    cout << format("Adding {1} to {2}, we get {3}") % a % b % (a+b);
+

Because the temporary value of (a+b) exists until the formatted data is actually written to the stream. But following code is wrong:

+
    format fmt("Adding {1} to {2}, we get {3}");
+    fmt % a;
+    fmt % b;
+    fmt % (a+b);
+    cout << fmt;
+

Because the temporary value of (a+b) no longer exists when fmt is written to the stream. A correct solution would be:

+
    format fmt("Adding {1} to {2}, we get {3}");
+    fmt % a;
+    fmt % b;
+    int a_plus_b = a+b;
+    fmt % a_plus_b;
+    cout << fmt;
+
+ + + diff --git a/doc/html/main.html b/doc/html/main.html new file mode 100644 index 0000000..5eaedc1 --- /dev/null +++ b/doc/html/main.html @@ -0,0 +1,127 @@ + + + + +Boost.Locale: Boost.Locale + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Boost.Locale

+
+
+

+What is Boost.Locale?

+

Boost.Locale is a library that provides high quality localization facilities in a C++ way.

+

It gives powerful tools for development of cross platform localized software - the software that talks to user in its language.

+

Provided Features:

+
    +
  • Correct case conversion, case folding and normalization.
  • +
  • Collation (sorting), including support for 4 Unicode collation levels.
  • +
  • Date, time, timezone and calendar manipulations, formatting and parsing, including transparent support for calendars other than Gregorian.
  • +
  • Boundary analysis for characters, words, sentences and line-breaks.
  • +
  • Number formatting, spelling and parsing.
  • +
  • Monetary formatting and parsing.
  • +
  • Powerful message formatting (string translation) including support for plural forms, using GNU catalogs.
  • +
  • Character set conversion.
  • +
  • Transparent support for 8-bit character sets like Latin1
  • +
  • Support for char and wchar_t
  • +
  • Experimental support for C++0x char16_t and char32_t strings and streams.
  • +
+

Boost.Locale enhances and unifies the standard library's API the way it becomes useful and convenient for development of cross platform and "cross-culture" software.

+

In order to achieve this goal Boost.Locale uses the-state-of-the-art Unicode and Localization library: ICU - International Components for Unicode.

+

Boost.Locale creates the natural glue between the C++ locales framework, iostreams, and the powerful ICU library.

+

Boost.Locale provides non-ICU based localization support as well. It is based on the operating system native API or on the standard C++ library support. Sacrificing some less important features, Boost.Locale becomes less powerful but lighter and easier to deploy and use library.

+

+Tutorials

+ +
+ + + diff --git a/doc/html/message_8hpp_source.html b/doc/html/message_8hpp_source.html new file mode 100644 index 0000000..cf25945 --- /dev/null +++ b/doc/html/message_8hpp_source.html @@ -0,0 +1,664 @@ + + + + +Boost.Locale: boost/locale/message.hpp Source File + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + diff --git a/doc/html/messages_formatting.html b/doc/html/messages_formatting.html new file mode 100644 index 0000000..952359d --- /dev/null +++ b/doc/html/messages_formatting.html @@ -0,0 +1,431 @@ + + + + +Boost.Locale: Messages Formatting (Translation) + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Messages Formatting (Translation)

+
+
+ +

+Introduction

+

Messages formatting is probably the most important part of the localization - making your application speak in the user's language.

+

Boost.Locale uses the GNU Gettext localization model. We recommend you read the general documentation of GNU Gettext, as it is outside the scope of this document.

+

The model is following:

+
    +
  • First, our application foo is prepared for localization by calling the translate function for each message used in user interface.
    + For example:
        cout << "Hello World" << endl;
    +
    Is changed to
    +
        cout << translate("Hello World") << endl;
    +
  • +
  • Then all messages are extracted from the source code and a special foo.po file is generated that contains all of the original English strings.
    +
    +    ...
    +    msgid "Hello World"
    +    msgstr ""
    +    ...
    +    
  • +
  • The foo.po file is translated for the supported locales. For example, de.po, ar.po, en_CA.po , and he.po.
    +
    +    ...
    +    msgid "Hello World"
    +    msgstr "שלום עולם"
    +    
    And then compiled to the binary mo format and stored in the following file structure:
    +
    +    de
    +    de/LC_MESSAGES
    +    de/LC_MESSAGES/foo.mo
    +    en_CA/
    +    en_CA/LC_MESSAGES
    +    en_CA/LC_MESSAGES/foo.mo
    +    ...
    +    

    + When the application starts, it loads the required dictionaries. Then when the translate function is called and the message is written to an output stream, a dictionary lookup is performed and the localized message is written out instead.
  • +
+

+Loading dictionaries

+

All the dictionaries are loaded by the generator class. Using localized strings in the application, requires specification of the following parameters:

+
    +
  1. The search path of the dictionaries
  2. +
  3. The application domain (or name)
  4. +
+

This is done by calling the following member functions of the generator class:

+
    +
  • add_messages_path - add the root path to the dictionaries.
    + For example: if the dictionary is located at /usr/share/locale/ar/LC_MESSAGES/foo.mo, then path should be /usr/share/locale.
    +
  • +
  • add_messages_domain - add the domain (name) of the application. In the above case it would be "foo".
  • +
+
Note:
At least one domain and one path should be specified in order to load dictionaries.
+

This is an example of our first fully localized program:

+
#include <boost/locale.hpp>
+#include <iostream>
+
+using namespace std;
+using namespace boost::locale;
+
+int main()
+{
+    generator gen;
+
+    // Specify location of dictionaries
+    gen.add_messages_path(".");
+    gen.add_messages_domain("hello");
+
+    // Generate locales and imbue them to iostream
+    locale::global(gen(""));
+    cout.imbue(locale());
+
+    // Display a message using current system locale
+    cout << translate("Hello World") << endl;
+}
+

+Message Translation

+

There are two ways to translate messages:

+
    +
  • using boost::locale::translate() family of functions:
    + These functions create a special proxy object basic_message that can be converted to string according to given locale or written to std::ostream formatting the message in the std::ostream's locale.
    + It is very convenient for working with std::ostream object and for postponing message translation
  • +
  • Using boost::locale::gettext() family of functions:
    + These are functions that are used for direct message translation: they receive as a parameter an original message or a key and convert it to the std::basic_string in given locale.
    + These functions have similar names to thous used in the GNU Gettext library.
  • +
+

+Indirect Message Translation

+

The basic function that allows us to translate a message is boost::locale::translate() family of functions.

+

These functions use a character type CharType as template parameter and receive either CharType const * or std::basic_string<CharType> as input.

+

These functions receive an original message and return a special proxy object - basic_message<CharType>. This object holds all the required information for the message formatting.

+

When this object is written to an output ostream, it performs a dictionary lookup of the message according to the locale imbued in iostream.

+

If the message is found in the dictionary it is written to the output stream, otherwise the original string is written to the stream.

+

For example:

+
// Translate a simple message "Hello World!"
+std::cout << boost::locale::translate("Hello World!") << std::endl;
+

This allows the program to postpone translation of the message until the translation is actually needed, even to different locale targets.

+
// Several output stream that we write a message to
+// English, Japanese, Hebrew etc.
+// Each one them has installed std::locale object that represents
+// their specific locale
+std::ofstream en,ja,he,de,ar;
+
+// Send single message to multiple streams
+void send_to_all(message const &msg)
+{
+    // in each of the cases below
+    // the message is translated to different
+    // language
+    en << msg;
+    ja << msg;
+    he << msg;
+    de << msg;
+    ar << msg;
+}
+
+int main()
+{
+    ...
+    send_to_all(translate("Hello World"));
+}
+
Note:
+
    +
  • basic_message can be implicitly converted to an apopriate std::basic_string using the global locale:
    +
            std::wstring msg = translate(L"Do you want to open the file?");
    +
  • +
  • basic_message can be explicitly converted to a string using the str() member function for a specific locale.
    +
        std::locale ru_RU = ... ;
    +    std::string msg = translate("Do you want to open the file?").str(ru_RU);
    +
  • +
+

+Plural Forms

+

GNU Gettext catalogs have simple, robust and yet powerful plural forms support. We recommend to read the original GNU documentation here.

+

Let's try to solve a simple problem, displaying a message to the user:

+
    if(files == 1)
+        cout << translate("You have 1 file in the directory") << endl;
+    else
+        cout << format(translate("You have {1} files in the directory")) % files << endl;
+

This very simple task becomes quite complicated when we deal with languages other than English. Many languages have more than two plural forms. For example, in Hebrew there are special forms for single, double, plural, and plural above 10. They can't be distinguished by the simple rule "is n 1 or not"

+

The correct solution is to give a translator an ability to choose a plural form on its own. Thus the translate function can receive two additional parameters English plural form a number: translate(single,plural,count)

+

For example:

+
cout << format(translate( "You have {1} file in the directory",
+                          "You have {1} files in the directory",
+                          files)) % files << endl;
+

A special entry in the dictionary specifies the rule to choose the correct plural form in the target language. For example, the Slavic language family has 3 plural forms, that can be chosen using following equation:

+
    plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;
+

Such equation is stored in the message catalog itself and it is evaluated during translation to supply the correct form.

+

So the code above would display 3 different forms in Russian locale for values of 1, 3 and 5:

+
+У вас есть 1 файл в каталоге
+У вас есть 3 файла в каталоге
+У вас есть 5 файлов в каталоге
+

And for Japanese that does not have plural forms at all it would display the same message for any numeric value.

+

For more detailed information please refer to GNU Gettext: 11.2.6 Additional functions for plural forms

+

+Adding Context Information

+

In many cases it is not sufficient to provide only the original English string to get the correct translation. You sometimes need to provide some context information. In German, for example, a button labeled "open" is translated to "öffnen" in the context of "opening a file", or to "aufbauen" in the context of opening an internet connection.

+

In these cases you must add some context information to the original string, by adding a comment.

+
button->setLabel(translate("File","open"));
+

The context information is provided as the first parameter to the translate function in both singular and plural forms. The translator would see this context information and would be able to translate the "open" string correctly.

+

For example, this is how the po file would look:

+
msgctxt "File"
+msgid "open"
+msgstr "öffnen"
+
+msgctxt "Internet Connection"
+msgid "open"
+msgstr "aufbauen"
+
Note:
Context information requires more recent versions of the gettext tools (>=0.15) for extracting strings and formatting message catalogs.
+

+Working with multiple messages domains

+

In some cases it is useful to work with multiple message domains.

+

For example, if an application consists of several independent modules, it may have several domains - a separate domain for each module.

+

For example, developing a FooBar office suite we might have:

+
    +
  • a FooBar Word Processor, using the "foobarwriter" domain
  • +
  • a FooBar Spreadsheet, using the "foobarspreadsheet" domain
  • +
  • a FooBar Spell Checker, using the "foobarspell" domain
  • +
  • a FooBar File handler, using the "foobarodt" domain
  • +
+

There are three ways to use non-default domains:

+
    +
  • When working with iostream, you can use the parameterized manipulator as::domain(std::string const &), which allows switching domains in a stream:
    +
        cout << as::domain("foo") << translate("Hello") << as::domain("bar") << translate("Hello");
    +    // First translation is taken from dictionary foo and the other from dictionary bar
    +
  • +
  • You can specify the domain explicitly when converting a message object to a string:
        std::wstring foo_msg = translate(L"Hello World").str("foo");
    +    std::wstring bar_msg = translate(L"Hello World").str("bar");
    +
  • +
  • You can specify the domain directly using a convenience interface:
        MessageBox(dgettext("gui","Error Occurred"));
    +
  • +
+

+Direct translation (Convenience Interface)

+

Many applications do not write messages directly to an output stream or use only one locale in the process, so calling translate("Hello World").str() for a single message would be annoying. Thus Boost.Locale provides GNU Gettext-like localization functions for direct translation of the messages. However, unlike the GNU Gettext functions, the Boost.Locale translation functions provide an additional optional parameter (locale), and support wide, u16 and u32 strings.

+

The GNU Gettext like functions prototypes can be found in this section.

+

All of these functions can have different prefixes for different forms:

+
    +
  • d - translation in specific domain
  • +
  • n - plural form translation
  • +
  • p - translation in specific context
  • +
+
    MessageBoxW(0,pgettext(L"File Dialog",L"Open?").c_str(),gettext(L"Question").c_str(),MB_YESNO);
+

+Extracting messages from the source code

+

There are many tools to extract messages from the source code into the .po file format. The most popular and "native" tool is xgettext which is installed by default on most Unix systems and freely downloadable for Windows (see Using Gettext Tools on Windows).

+

For example, we have a source file called dir.cpp that prints:

+
    cout << translate("Listing of catalog {1}:") % file_name << endl;
+    cout << translate("Catalog {1} contains 1 file","Catalog {1} contains {2,num} files",files_no) 
+            % file_name % files_no << endl;
+

Now we run:

+
+xgettext --keyword=translate:1,1t --keyword=translate:1,2,3t dir.cpp
+

And a file called messages.po created that looks like this (approximately):

+
#: dir.cpp:1
+msgid "Listing of catalog {1}:"
+msgstr ""
+
+#: dir.cpp:2
+msgid "Catalog {1} contains 1 file"
+msgid_plural "Catalog {1} contains {2,num} files"
+msgstr[0] ""
+msgstr[1] ""
+

This file can be given to translators to adapt it to specific languages.

+

We used the --keyword parameter of xgettext to make it suitable for extracting messages from source code localized with Boost.Locale, searching for translate() function calls instead of the default gettext() and ngettext() ones. The first parameter --keyword=translate:1,1t provides the template for basic messages: a translate function that is called with 1 argument (1t) and the first message is taken as the key. The second one --keyword=translate:1,2,3t is used for plural forms. It tells xgettext to use a translate() function call with 3 parameters (3t) and take the 1st and 2nd parameter as keys. An additional marker Nc can be used to mark context information.

+

The full set of xgettext parameters suitable for Boost.Locale is:

+
xgettext --keyword=translate:1,1t --keyword=translate:1c,2,2t       \
+         --keyword=translate:1,2,3t --keyword=translate:1c,2,3,4t   \
+         --keyword=gettext:1 --keyword=pgettext:1c,2                \
+         --keyword=ngettext:1,2 --keyword=npgettext:1c,2,3          \
+         source_file_1.cpp ... source_file_N.cpp
+

Of course, if you do not use "gettext" like translation you may ignore some of these parameters.

+

+Custom Filesystem Support

+

When the access to actual file system is limited like in ActiveX controls or when the developer wants to ship all-in-one executable file, it is useful to be able to load gettext catalogs from a custom location - a custom file system.

+

Boost.Locale provides an option to install boost::locale::message_format facet with customized options provided in boost::locale::gnu_gettext::messages_info structure.

+

This structure contains boost::function based callback that allows user to provide custom functionality to load message catalog files.

+

For example:

+
// Configure all options for message catalog
+namespace blg = boost::locale::gnu_gettext;
+blg::messages_info info;
+info.language = "he";
+info.country = "IL";
+info.encoding="UTF-8";
+info.paths.push_back(""); // You need some even empty path
+info.domains.push_back(blg::messages_info::domain("my_app"));
+info.callback = some_file_loader; // Provide a callback
+
+// Create a basic locale without messages support
+boost::locale::generator gen;
+std::locale base_locale = gen("he_IL.UTF-8");
+
+// Install messages catalogs for "char" support to the final locale
+// we are going to use
+std::locale real_locale(base_locale,blg::create_messages_facet<char>(info));
+

In order to setup language, country and other members you may use boost::locale::info facet for convenience,

+
// Configure all options for message catalog
+namespace blg = boost::locale::gnu_gettext;
+blg::messages_info info;
+
+info.paths.push_back(""); // You need some even empty path
+info.domains.push_back(blg::messages_info::domain("my_app"));
+info.callback = some_file_loader; // Provide a callback
+
+// Create an object with default locale
+std::locale base_locale = gen("");
+
+// Use boost::locale::info to configure all parameters
+
+boost::locale::info const &properties = std::use_facet<boost::locale::info>(base_locale);
+info.language = properties.language();
+info.country  = properties.country();
+info.encoding = properties.encoding();
+info.variant  = properties.variant();
+
+// Install messages catalogs to the final locale
+std::locale real_locale(base_locale,blg::create_messages_facet<char>(info));
+

+Non US-ASCII Keys

+

Boost.Locale assumes that you use English for original text messages. And the best practice is to use US-ASCII characters for original keys.

+

However in some cases it us useful in insert some Unicode characters in text like for example Copyright "©" character.

+

As long as your narrow character string encoding is UTF-8 nothing further should be done.

+

Boost.Locale assumes that your sources are encoded in UTF-8 and the input narrow string use UTF-8 - which is the default for most compilers around (with notable exception of Microsoft Visual C++).

+

However if your narrow strings encoding in the source file is not UTF-8 but some other encoding like windows-1252, the string would be misinterpreted.

+

You can specify the character set of the original strings when you specify the domain name for the application.

+
#include <boost/locale.hpp>
+#include <iostream>
+
+using namespace std;
+using namespace boost::locale;
+
+int main()
+{
+    generator gen;
+
+    // Specify location of dictionaries
+    gen.add_messages_path(".");
+    // Specify the encoding of the source string
+    gen.add_messages_domain("copyrighted/windows-1255");
+
+    // Generate locales and imbue them to iostream
+    locale::global(gen(""));
+    cout.imbue(locale());
+    
+    // In Windows 1255 (C) symbol is encoded as 0xA9
+    cout << translate("© 2001 All Rights Reserved") << endl;
+}
+

Thus if the programs runs in UTF-8 locale the copyright symbol would be automatically converted to an appropriate UTF-8 sequence if the key is missing in the dictionary.

+

+Questions and Answers

+
    +
  • Do I need GNU Gettext to use Boost.Locale?
    + Boost.Locale provides a run-time environment to load and use GNU Gettext message catalogs, but it does not provide tools for generation, translation, compilation and management of these catalogs. Boost.Locale only reimplements the GNU Gettext libintl.
    + You would probably need:
    +
      +
    1. Boost.Locale itself -- for runtime.
    2. +
    3. A tool for extracting strings from source code, and managing them: GNU Gettext provides good tools, but other implementations are available as well.
    4. +
    5. A good translation program like Lokalize, Pedit or GTranslator.
    6. +
    +
  • +
+
    +
  • Why doesn't Boost.Locale provide tools for extracting and management of message catalogs. Why should I use GPL-ed software? Are my programs or message catalogs affected by its license?
    +
      +
    1. Boost.Locale does not link to or use any of the GNU Gettext code, so you need not worry about your code as the runtime library is fully reimplemented.
    2. +
    3. You may freely use GPL-ed software for extracting and managing catalogs, the same way as you are free to use a GPL-ed editor. It does not affect your message catalogs or your code.
    4. +
    5. I see no reason to reimplement well debugged, working tools like xgettext, msgfmt, msgmerge that do a very fine job, especially as they are freely available for download and support almost any platform. All Linux distributions, BSD Flavors, Mac OS X and other Unix like operating systems provide GNU Gettext tools as a standard package.
      + Windows users can get GNU Gettext utilities via MinGW project. See Using Gettext Tools on Windows.
    6. +
    +
  • +
+
    +
  • Is there any reason to prefer the Boost.Locale implementation to the original GNU Gettext runtime library? In either case I would probably need some of the GNU tools.
    + There are two important differences between the GNU Gettext runtime library and the Boost.Locale implementation:
    +
      +
    1. The GNU Gettext runtime supports only one locale per process. It is not thread-safe to use multiple locales and encodings in the same process. This is perfectly fine for applications that interact directly with a single user like most GUI applications, but is problematic for services and servers.
    2. +
    3. The GNU Gettext API supports only 8-bit encodings, making it irrelevant in environments that natively use wide strings.
    4. +
    5. The GNU Gettext runtime library distributed under LGPL license which may be not convenient for some users.
    6. +
    +
  • +
+
+ + + diff --git a/doc/html/modules.html b/doc/html/modules.html new file mode 100644 index 0000000..ec9627d --- /dev/null +++ b/doc/html/modules.html @@ -0,0 +1,81 @@ + + + + +Boost.Locale: Module Index + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Modules

+
+ + + + diff --git a/doc/html/namespaceboost_1_1locale.html b/doc/html/namespaceboost_1_1locale.html new file mode 100644 index 0000000..0a2174f --- /dev/null +++ b/doc/html/namespaceboost_1_1locale.html @@ -0,0 +1,377 @@ + + + + +Boost.Locale: boost::locale Namespace Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale Namespace Reference

+
+
+ +

This is the main namespace that encloses all localization classes. +More...

+ + + + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Namespaces

namespace  as
 

This namespace includes all manipulators that can be used on IO streams.

+
namespace  boundary
 

This namespae contains all operations required for boundary analysis of text.

+
namespace  conv
 

Namespace that contains all functions related to character set conversion.

+
namespace  flags
 

This namespace holds additional formatting flags that can be set using ios_info.

+
namespace  gnu_gettext
 

This namespace holds classes that provide GNU Gettext message catalogs support.

+
namespace  period
 

Namespace that contains various types for manipulation with dates.

+
namespace  time_zone
 

namespace that holds functions for operating with global time zone

+
namespace  util
 

This namespace provides various utility function useful for Boost.Locale backends implementations.

+

+Classes

class  collator_base
 a base class that includes collation level flags More...
class  collator
 Collation facet. More...
struct  comparator
 This class can be used in STL algorithms and containers for comparison of strings with a level other than primary. More...
class  converter_base
 This class provides base flags for text manipulation. It is used as base for converter facet. More...
class  converter
 The facet that implements text manipulation. More...
class  date_time_error
 This error is thrown in case of invalid state that occurred. More...
struct  date_time_period
 This class represents a pair of period_type and the integer values that describes its amount. For example 3 days or 4 years. More...
class  date_time_period_set
 this class that represents a set of periods, More...
class  calendar
 this class provides an access to general calendar information. More...
class  date_time
 this class represents a date time and allows to perform various operation according to the locale settings. More...
class  date_time_duration
 This class represents a period: a pair of two date_time objects. More...
struct  posix_time
class  abstract_calendar
class  calendar_facet
 the facet that generates calendar for specific locale More...
class  basic_format
 a printf like class that allows type-safe and locale aware message formatting More...
class  ios_info
 This class holds an external data - beyond existing fmtflags that std::ios_base holds. More...
class  generator
 the major class used for locale generation More...
class  hold_ptr
 a smart pointer similar to std::auto_ptr but it is non-copyable and the underlying object has the same constness as the pointer itself (unlike an ordinary pointer). More...
class  info
 a facet that holds general information about locale More...
class  localization_backend
 this class represents a localization backend that can be used for localizing your application. More...
class  localization_backend_manager
 Localization backend manager is a class that holds various backend and allows creation of their combination or selection. More...
class  message_format
 This facet provides message formatting abilities. More...
class  basic_message
 This class represents a message that can be converted to a specific locale message. More...

+Typedefs

typedef basic_format< char > format
typedef basic_format< wchar_t > wformat
typedef basic_format< char16_t > u16format
typedef basic_format< char32_t > u32format
+typedef uint32_t character_facet_type
 type that specifies the character type that locales can be generated for
+typedef uint32_t locale_category_type
 a type used for more fine grained generation of facets
typedef basic_message< char > message
typedef basic_message< wchar_t > wmessage
typedef basic_message< char16_t > u16message
typedef basic_message< char32_t > u32message

+Enumerations

enum  norm_type {
+  norm_nfd, +norm_nfc, +norm_nfkd, +norm_nfkc, +
+  norm_default = norm_nfc +
+ }

+Functions

template<typename CharType >
std::basic_string< CharType > normalize (std::basic_string< CharType > const &str, norm_type n=norm_default, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > normalize (CharType const *str, norm_type n=norm_default, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > normalize (CharType const *begin, CharType const *end, norm_type n=norm_default, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > to_upper (std::basic_string< CharType > const &str, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > to_upper (CharType const *str, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > to_upper (CharType const *begin, CharType const *end, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > to_lower (std::basic_string< CharType > const &str, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > to_lower (CharType const *str, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > to_lower (CharType const *begin, CharType const *end, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > to_title (std::basic_string< CharType > const &str, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > to_title (CharType const *str, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > to_title (CharType const *begin, CharType const *end, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > fold_case (std::basic_string< CharType > const &str, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > fold_case (CharType const *str, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > fold_case (CharType const *begin, CharType const *end, std::locale const &loc=std::locale())
date_time_period_set operator+ (date_time_period_set const &a, date_time_period_set const &b)
date_time_period_set operator- (date_time_period_set const &a, date_time_period_set const &b)
template<typename CharType >
std::basic_ostream< CharType > & operator<< (std::basic_ostream< CharType > &out, date_time const &t)
template<typename CharType >
std::basic_istream< CharType > & operator>> (std::basic_istream< CharType > &in, date_time &t)
date_time_duration operator- (date_time const &later, date_time const &earlier)
template<typename CharType >
std::basic_ostream< CharType > & operator<< (std::basic_ostream< CharType > &out, basic_format< CharType > const &fmt)
template<typename CharType >
std::basic_ostream< CharType > & operator<< (std::basic_ostream< CharType > &out, basic_message< CharType > const &msg)
Indirect message translation function family

+
+template<typename CharType >
basic_message< CharType > translate (CharType const *msg)
 Translate a message, msg is not copied.
+template<typename CharType >
basic_message< CharType > translate (CharType const *context, CharType const *msg)
 Translate a message in context, msg and context are not copied.
+template<typename CharType >
basic_message< CharType > translate (CharType const *single, CharType const *plural, int n)
 Translate a plural message form, single and plural are not copied.
+template<typename CharType >
basic_message< CharType > translate (CharType const *context, CharType const *single, CharType const *plural, int n)
 Translate a plural message from in constext, context, single and plural are not copied.
+template<typename CharType >
basic_message< CharType > translate (std::basic_string< CharType > const &msg)
 Translate a message, msg is copied.
+template<typename CharType >
basic_message< CharType > translate (std::basic_string< CharType > const &context, std::basic_string< CharType > const &msg)
 Translate a message in context,context and msg is copied.
+template<typename CharType >
basic_message< CharType > translate (std::basic_string< CharType > const &context, std::basic_string< CharType > const &single, std::basic_string< CharType > const &plural, int n)
 Translate a plural message form in constext, context, single and plural are copied.
+template<typename CharType >
basic_message< CharType > translate (std::basic_string< CharType > const &single, std::basic_string< CharType > const &plural, int n)
 Translate a plural message form, single and plural are copied.
Direct message translation functions family

+
template<typename CharType >
std::basic_string< CharType > gettext (CharType const *id, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > ngettext (CharType const *s, CharType const *p, int n, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > dgettext (char const *domain, CharType const *id, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > dngettext (char const *domain, CharType const *s, CharType const *p, int n, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > pgettext (CharType const *context, CharType const *id, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > npgettext (CharType const *context, CharType const *s, CharType const *p, int n, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > dpgettext (char const *domain, CharType const *context, CharType const *id, std::locale const &loc=std::locale())
template<typename CharType >
std::basic_string< CharType > dnpgettext (char const *domain, CharType const *context, CharType const *s, CharType const *p, int n, std::locale const &loc=std::locale())

+Variables

+static const uint32_t nochar_facet = 0
 Unspecified character category for character independent facets.
+static const uint32_t char_facet = 1 << 0
 8-bit character facets
+static const uint32_t wchar_t_facet = 1 << 1
 wide character facets
+static const uint32_t char16_t_facet = 1 << 2
 C++0x char16_t facets.
+static const uint32_t char32_t_facet = 1 << 3
 C++0x char32_t facets.
+static const uint32_t character_first_facet = char_facet
 First facet specific for character type.
+static const uint32_t character_last_facet = char32_t_facet
 Last facet specific for character type.
+static const uint32_t all_characters = 0xFFFF
 Special mask -- generate all.
+static const uint32_t convert_facet = 1 << 0
 Generate conversion facets.
+static const uint32_t collation_facet = 1 << 1
 Generate collation facets.
+static const uint32_t formatting_facet = 1 << 2
 Generate numbers, currency, date-time formatting facets.
+static const uint32_t parsing_facet = 1 << 3
 Generate numbers, currency, date-time formatting facets.
+static const uint32_t message_facet = 1 << 4
 Generate message facets.
+static const uint32_t codepage_facet = 1 << 5
 Generate character set conversion facets (derived from std::codecvt).
+static const uint32_t boundary_facet = 1 << 6
 Generate boundary analysis facet.
+static const uint32_t per_character_facet_first = convert_facet
 First facet specific for character.
+static const uint32_t per_character_facet_last = boundary_facet
 Last facet specific for character.
+static const uint32_t calendar_facet = 1 << 16
 Generate boundary analysis facet.
+static const uint32_t information_facet = 1 << 17
 Generate general locale information facet.
+static const uint32_t non_character_facet_first = calendar_facet
 First character independent facet.
+static const uint32_t non_character_facet_last = information_facet
 Last character independent facet.
+static const uint32_t all_categories = 0xFFFFFFFFu
 Generate all of them.
+

Detailed Description

+

This is the main namespace that encloses all localization classes.

+
+ + + diff --git a/doc/html/namespaceboost_1_1locale_1_1as.html b/doc/html/namespaceboost_1_1locale_1_1as.html new file mode 100644 index 0000000..67d800f --- /dev/null +++ b/doc/html/namespaceboost_1_1locale_1_1as.html @@ -0,0 +1,130 @@ + + + + +Boost.Locale: boost::locale::as Namespace Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::as Namespace Reference
+ +[Message Formatting (translation)] +

+
+
+ +

This namespace includes all manipulators that can be used on IO streams. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

std::ios_base & posix (std::ios_base &ios)
std::ios_base & number (std::ios_base &ios)
std::ios_base & currency (std::ios_base &ios)
std::ios_base & percent (std::ios_base &ios)
std::ios_base & date (std::ios_base &ios)
std::ios_base & time (std::ios_base &ios)
std::ios_base & datetime (std::ios_base &ios)
std::ios_base & strftime (std::ios_base &ios)
std::ios_base & spellout (std::ios_base &ios)
std::ios_base & ordinal (std::ios_base &ios)
std::ios_base & currency_default (std::ios_base &ios)
std::ios_base & currency_iso (std::ios_base &ios)
std::ios_base & currency_national (std::ios_base &ios)
std::ios_base & time_default (std::ios_base &ios)
std::ios_base & time_short (std::ios_base &ios)
std::ios_base & time_medium (std::ios_base &ios)
std::ios_base & time_long (std::ios_base &ios)
std::ios_base & time_full (std::ios_base &ios)
std::ios_base & date_default (std::ios_base &ios)
std::ios_base & date_short (std::ios_base &ios)
std::ios_base & date_medium (std::ios_base &ios)
std::ios_base & date_long (std::ios_base &ios)
std::ios_base & date_full (std::ios_base &ios)
template<typename CharType >
unspecified_type ftime (std::basic_string< CharType > const &format)
template<typename CharType >
unspecified_type ftime (CharType const *format)
std::ios_base & gmt (std::ios_base &ios)
std::ios_base & local_time (std::ios_base &ios)
unspecified_type time_zone (char const *id)
unspecified_type time_zone (std::string const &id)
unspecified_type domain (std::string const &id)
+

Detailed Description

+

This namespace includes all manipulators that can be used on IO streams.

+
+ + + diff --git a/doc/html/namespaceboost_1_1locale_1_1boundary.html b/doc/html/namespaceboost_1_1locale_1_1boundary.html new file mode 100644 index 0000000..a6d5604 --- /dev/null +++ b/doc/html/namespaceboost_1_1locale_1_1boundary.html @@ -0,0 +1,444 @@ + + + + +Boost.Locale: boost::locale::boundary Namespace Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::boundary Namespace Reference

+
+
+ +

This namespae contains all operations required for boundary analysis of text. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Classes

class  boundary_point
 This class represents a boundary point in the text. More...
struct  break_info
 This structure is used for representing boundary point that follows the offset. More...
class  boundary_indexing
 This facet generates an index for boundary analysis for a given text. More...
class  segment_index
 This class holds an index of segments in the text range and allows to iterate over them. More...
class  boundary_point_index
 This class holds an index of boundary points and allows iterating over them. More...
class  segment
 a segment object that represents a pair of two iterators that define the range where this segment exits and a rule that defines it. More...

+Typedefs

+typedef boundary_point
+< std::string::const_iterator > 
sboundary_point
 convenience typedef
+typedef boundary_point
+< std::wstring::const_iterator > 
wsboundary_point
 convenience typedef
+typedef boundary_point
+< std::u16string::const_iterator > 
u16sboundary_point
 convenience typedef
+typedef boundary_point
+< std::u32string::const_iterator > 
u32sboundary_point
 convenience typedef
+typedef boundary_point< char
+const * > 
cboundary_point
 convenience typedef
+typedef boundary_point
+< wchar_t const * > 
wcboundary_point
 convenience typedef
+typedef boundary_point
+< char16_t const * > 
u16cboundary_point
 convenience typedef
+typedef boundary_point
+< char32_t const * > 
u32cboundary_point
 convenience typedef
typedef std::vector< break_infoindex_type
typedef segment_index
+< std::string::const_iterator > 
ssegment_index
+typedef segment_index
+< std::wstring::const_iterator > 
wssegment_index
 convenience typedef
+typedef segment_index
+< std::u16string::const_iterator > 
u16ssegment_index
 convenience typedef
+typedef segment_index
+< std::u32string::const_iterator > 
u32ssegment_index
 convenience typedef
+typedef segment_index< char
+const * > 
csegment_index
 convenience typedef
+typedef segment_index< wchar_t
+const * > 
wcsegment_index
 convenience typedef
+typedef segment_index
+< char16_t const * > 
u16csegment_index
 convenience typedef
+typedef segment_index
+< char32_t const * > 
u32csegment_index
 convenience typedef
+typedef boundary_point_index
+< std::string::const_iterator > 
sboundary_point_index
 convenience typedef
+typedef boundary_point_index
+< std::wstring::const_iterator > 
wsboundary_point_index
 convenience typedef
+typedef boundary_point_index
+< std::u16string::const_iterator > 
u16sboundary_point_index
 convenience typedef
+typedef boundary_point_index
+< std::u32string::const_iterator > 
u32sboundary_point_index
 convenience typedef
+typedef boundary_point_index
+< char const * > 
cboundary_point_index
 convenience typedef
+typedef boundary_point_index
+< wchar_t const * > 
wcboundary_point_index
 convenience typedef
+typedef boundary_point_index
+< char16_t const * > 
u16cboundary_point_index
 convenience typedef
+typedef boundary_point_index
+< char32_t const * > 
u32cboundary_point_index
 convenience typedef
+typedef segment
+< std::string::const_iterator > 
ssegment
 convenience typedef
+typedef segment
+< std::wstring::const_iterator > 
wssegment
 convenience typedef
+typedef segment
+< std::u16string::const_iterator > 
u16ssegment
 convenience typedef
+typedef segment
+< std::u32string::const_iterator > 
u32ssegment
 convenience typedef
+typedef segment< char const * > csegment
 convenience typedef
+typedef segment< wchar_t const * > wcsegment
 convenience typedef
+typedef segment< char16_t const * > u16csegment
 convenience typedef
+typedef segment< char32_t const * > u32csegment
 convenience typedef
typedef uint32_t rule_type
 Flags used with word boundary analysis -- the type of the word, line or sentence boundary found.

+Enumerations

enum  boundary_type { character, +word, +sentence, +line + }

+Functions

template<typename BaseIterator >
bool operator== (BaseIterator const &l, boundary_point< BaseIterator > const &r)
template<typename BaseIterator >
bool operator!= (BaseIterator const &l, boundary_point< BaseIterator > const &r)
+template<typename IteratorL , typename IteratorR >
bool operator== (segment< IteratorL > const &l, segment< IteratorR > const &r)
 Compare two segments.
+template<typename IteratorL , typename IteratorR >
bool operator!= (segment< IteratorL > const &l, segment< IteratorR > const &r)
 Compare two segments.
+template<typename IteratorL , typename IteratorR >
bool operator< (segment< IteratorL > const &l, segment< IteratorR > const &r)
 Compare two segments.
+template<typename IteratorL , typename IteratorR >
bool operator<= (segment< IteratorL > const &l, segment< IteratorR > const &r)
 Compare two segments.
+template<typename IteratorL , typename IteratorR >
bool operator> (segment< IteratorL > const &l, segment< IteratorR > const &r)
 Compare two segments.
+template<typename IteratorL , typename IteratorR >
bool operator>= (segment< IteratorL > const &l, segment< IteratorR > const &r)
 Compare two segments.
+template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool operator== (std::basic_string< CharType, Traits, Alloc > const &l, segment< IteratorR > const &r)
 Compare string and segment.
+template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool operator!= (std::basic_string< CharType, Traits, Alloc > const &l, segment< IteratorR > const &r)
 Compare string and segment.
+template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool operator< (std::basic_string< CharType, Traits, Alloc > const &l, segment< IteratorR > const &r)
 Compare string and segment.
+template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool operator<= (std::basic_string< CharType, Traits, Alloc > const &l, segment< IteratorR > const &r)
 Compare string and segment.
+template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool operator> (std::basic_string< CharType, Traits, Alloc > const &l, segment< IteratorR > const &r)
 Compare string and segment.
+template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool operator>= (std::basic_string< CharType, Traits, Alloc > const &l, segment< IteratorR > const &r)
 Compare string and segment.
+template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool operator== (segment< Iterator > const &l, std::basic_string< CharType, Traits, Alloc > const &r)
 Compare string and segment.
+template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool operator!= (segment< Iterator > const &l, std::basic_string< CharType, Traits, Alloc > const &r)
 Compare string and segment.
+template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool operator< (segment< Iterator > const &l, std::basic_string< CharType, Traits, Alloc > const &r)
 Compare string and segment.
+template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool operator<= (segment< Iterator > const &l, std::basic_string< CharType, Traits, Alloc > const &r)
 Compare string and segment.
+template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool operator> (segment< Iterator > const &l, std::basic_string< CharType, Traits, Alloc > const &r)
 Compare string and segment.
+template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool operator>= (segment< Iterator > const &l, std::basic_string< CharType, Traits, Alloc > const &r)
 Compare string and segment.
+template<typename CharType , typename IteratorR >
bool operator== (CharType const *l, segment< IteratorR > const &r)
 Compare C string and segment.
+template<typename CharType , typename IteratorR >
bool operator!= (CharType const *l, segment< IteratorR > const &r)
 Compare C string and segment.
+template<typename CharType , typename IteratorR >
bool operator< (CharType const *l, segment< IteratorR > const &r)
 Compare C string and segment.
+template<typename CharType , typename IteratorR >
bool operator<= (CharType const *l, segment< IteratorR > const &r)
 Compare C string and segment.
+template<typename CharType , typename IteratorR >
bool operator> (CharType const *l, segment< IteratorR > const &r)
 Compare C string and segment.
+template<typename CharType , typename IteratorR >
bool operator>= (CharType const *l, segment< IteratorR > const &r)
 Compare C string and segment.
+template<typename Iterator , typename CharType >
bool operator== (segment< Iterator > const &l, CharType const *r)
 Compare C string and segment.
+template<typename Iterator , typename CharType >
bool operator!= (segment< Iterator > const &l, CharType const *r)
 Compare C string and segment.
+template<typename Iterator , typename CharType >
bool operator< (segment< Iterator > const &l, CharType const *r)
 Compare C string and segment.
+template<typename Iterator , typename CharType >
bool operator<= (segment< Iterator > const &l, CharType const *r)
 Compare C string and segment.
+template<typename Iterator , typename CharType >
bool operator> (segment< Iterator > const &l, CharType const *r)
 Compare C string and segment.
+template<typename Iterator , typename CharType >
bool operator>= (segment< Iterator > const &l, CharType const *r)
 Compare C string and segment.
template<typename CharType , typename TraitsType , typename Iterator >
std::basic_ostream< CharType,
+TraitsType > & 
operator<< (std::basic_ostream< CharType, TraitsType > &out, segment< Iterator > const &tok)
rule_type boundary_rule (boundary_type t)

+Variables

Flags that describe a type of word selected

+
+static const rule_type word_none = 0x0000F
 Not a word, like white space or punctuation mark.
+static const rule_type word_number = 0x000F0
 Word that appear to be a number.
+static const rule_type word_letter = 0x00F00
 Word that contains letters, excluding kana and ideographic characters.
+static const rule_type word_kana = 0x0F000
 Word that contains kana characters.
+static const rule_type word_ideo = 0xF0000
 Word that contains ideographic characters.
+static const rule_type word_any = 0xFFFF0
 Any word including numbers, 0 is special flag, equivalent to 15.
+static const rule_type word_letters = 0xFFF00
 Any word, excluding numbers but including letters, kana and ideograms.
+static const rule_type word_kana_ideo = 0xFF000
 Word that includes kana or ideographic characters.
static const rule_type word_mask = 0xFFFFF
Flags that describe a type of line break

+
+static const rule_type line_soft = 0x0F
 Soft line break: optional but not required.
+static const rule_type line_hard = 0xF0
 Hard line break: like break is required (as per CR/LF).
+static const rule_type line_any = 0xFF
 Soft or Hard line break.
+static const rule_type line_mask = 0xFF
 Select all types of line breaks.
Flags that describe a type of sentence break

+
+static const rule_type sentence_term = 0x0F
 The sentence was terminated with a sentence terminator like ".", "!" possible followed by hard separator like CR, LF, PS.
+static const rule_type sentence_sep = 0xF0
 The sentence does not contain terminator like ".", "!" but ended with hard separator like CR, LF, PS or end of input.
+static const rule_type sentence_any = 0xFF
 Either first or second sentence break type;.
+static const rule_type sentence_mask = 0xFF
 Select all sentence breaking points.
Flags that describe a type of character break.

At this point break iterator does not distinguish different kinds of characters so it is used for consistency.

+
+static const rule_type character_any = 0xF
 Not in use, just for consistency.
+static const rule_type character_mask = 0xF
 Select all character breaking points.
+

Detailed Description

+

This namespae contains all operations required for boundary analysis of text.

+

This namespase contains all operations required for boundary analysis of text.

+
+ + + diff --git a/doc/html/namespaceboost_1_1locale_1_1conv.html b/doc/html/namespaceboost_1_1locale_1_1conv.html new file mode 100644 index 0000000..06b7702 --- /dev/null +++ b/doc/html/namespaceboost_1_1locale_1_1conv.html @@ -0,0 +1,142 @@ + + + + +Boost.Locale: boost::locale::conv Namespace Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::conv Namespace Reference

+
+
+ +

Namespace that contains all functions related to character set conversion. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Classes

class  conversion_error
 The excepton that is thrown in case of conversion error. More...
class  invalid_charset_error
 This exception is thrown in case of use of unsupported or invalid character set. More...

+Enumerations

enum  method_type { skip = 0, +stop = 1, +default_method = skip + }

+Functions

template<typename CharType >
std::basic_string< CharType > to_utf (char const *begin, char const *end, std::string const &charset, method_type how=default_method)
template<typename CharType >
std::string from_utf (CharType const *begin, CharType const *end, std::string const &charset, method_type how=default_method)
template<typename CharType >
std::basic_string< CharType > to_utf (char const *begin, char const *end, std::locale const &loc, method_type how=default_method)
template<typename CharType >
std::string from_utf (CharType const *begin, CharType const *end, std::locale const &loc, method_type how=default_method)
template<typename CharType >
std::basic_string< CharType > to_utf (std::string const &text, std::string const &charset, method_type how=default_method)
template<typename CharType >
std::string from_utf (std::basic_string< CharType > const &text, std::string const &charset, method_type how=default_method)
template<typename CharType >
std::basic_string< CharType > to_utf (char const *text, std::string const &charset, method_type how=default_method)
template<typename CharType >
std::string from_utf (CharType const *text, std::string const &charset, method_type how=default_method)
template<typename CharType >
std::basic_string< CharType > to_utf (std::string const &text, std::locale const &loc, method_type how=default_method)
template<typename CharType >
std::string from_utf (std::basic_string< CharType > const &text, std::locale const &loc, method_type how=default_method)
template<typename CharType >
std::basic_string< CharType > to_utf (char const *text, std::locale const &loc, method_type how=default_method)
template<typename CharType >
std::string from_utf (CharType const *text, std::locale const &loc, method_type how=default_method)
std::string between (char const *begin, char const *end, std::string const &to_encoding, std::string const &from_encoding, method_type how=default_method)
std::string between (char const *text, std::string const &to_encoding, std::string const &from_encoding, method_type how=default_method)
std::string between (std::string const &text, std::string const &to_encoding, std::string const &from_encoding, method_type how=default_method)
template<typename CharOut , typename CharIn >
std::basic_string< CharOut > utf_to_utf (CharIn const *begin, CharIn const *end, method_type how=default_method)
template<typename CharOut , typename CharIn >
std::basic_string< CharOut > utf_to_utf (CharIn const *str, method_type how=default_method)
template<typename CharOut , typename CharIn >
std::basic_string< CharOut > utf_to_utf (std::basic_string< CharIn > const &str, method_type how=default_method)
+

Detailed Description

+

Namespace that contains all functions related to character set conversion.

+
+ + + diff --git a/doc/html/namespaceboost_1_1locale_1_1flags.html b/doc/html/namespaceboost_1_1locale_1_1flags.html new file mode 100644 index 0000000..3de1586 --- /dev/null +++ b/doc/html/namespaceboost_1_1locale_1_1flags.html @@ -0,0 +1,197 @@ + + + + +Boost.Locale: boost::locale::flags Namespace Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::flags Namespace Reference

+
+
+ +

This namespace holds additional formatting flags that can be set using ios_info. +More...

+ + + + + +

+Enumerations

enum  display_flags_type {
+  posix = 0, +number = 1, +currency = 2, +percent = 3, +
+  date = 4, +time = 5, +datetime = 6, +strftime = 7, +
+  spellout = 8, +ordinal = 9, +display_flags_mask = 31, +currency_default = 0 << 5, +
+  currency_iso = 1 << 5, +currency_national = 2 << 5, +currency_flags_mask = 3 << 5, +time_default = 0 << 7, +
+  time_short = 1 << 7, +time_medium = 2 << 7, +time_long = 3 << 7, +time_full = 4 << 7, +
+  time_flags_mask = 7 << 7, +date_default = 0 << 10, +date_short = 1 << 10, +date_medium = 2 << 10, +
+  date_long = 3 << 10, +date_full = 4 << 10, +date_flags_mask = 7 << 10, +datetime_flags_mask = date_flags_mask | time_flags_mask +
+ }
enum  pattern_type { datetime_pattern, +time_zone_id + }
enum  value_type { domain_id + }
+

Detailed Description

+

This namespace holds additional formatting flags that can be set using ios_info.

+

Enumeration Type Documentation

+ +
+ +
+

Formatting flags, each one of them has corresponding manipulation in namespace as

+ +
+
+ +
+ +
+

Special string patters that can be used for text formatting

+
Enumerator:
+ + +
datetime_pattern  +

strftime like formatting

+
time_zone_id  +

time zone name

+
+
+
+ +
+
+ +
+ +
+

Special integer values that can be used for formatting

+
Enumerator:
+ +
domain_id  +

Domain code - for message formatting.

+
+
+
+ +
+
+
+ + + diff --git a/doc/html/namespaceboost_1_1locale_1_1gnu__gettext.html b/doc/html/namespaceboost_1_1locale_1_1gnu__gettext.html new file mode 100644 index 0000000..6a89c40 --- /dev/null +++ b/doc/html/namespaceboost_1_1locale_1_1gnu__gettext.html @@ -0,0 +1,127 @@ + + + + +Boost.Locale: boost::locale::gnu_gettext Namespace Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::gnu_gettext Namespace Reference
+ +[Message Formatting (translation)] +

+
+
+ +

This namespace holds classes that provide GNU Gettext message catalogs support. +More...

+ + + + + + + +

+Classes

struct  messages_info
 This structure holds all information required for creating gnu-gettext message catalogs,. More...

+Functions

template<typename CharType >
message_format< CharType > * create_messages_facet (messages_info const &info)
+

Detailed Description

+

This namespace holds classes that provide GNU Gettext message catalogs support.

+

Function Documentation

+ +
+
+
+template<typename CharType >
+ + + + + + + + + +
message_format<CharType>* boost::locale::gnu_gettext::create_messages_facet (messages_info const &  info ) 
+
+
+

Create a message_format facet using GNU Gettext catalogs. It uses info structure to get information about where to read them from and uses it for character set conversion (if needed)

+ +
+
+
+ + + diff --git a/doc/html/namespaceboost_1_1locale_1_1period.html b/doc/html/namespaceboost_1_1locale_1_1period.html new file mode 100644 index 0000000..094ce2c --- /dev/null +++ b/doc/html/namespaceboost_1_1locale_1_1period.html @@ -0,0 +1,2049 @@ + + + + +Boost.Locale: boost::locale::period Namespace Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::period Namespace Reference
+ +[Date, Time, Timezone and Calendar manipulations] +

+
+
+ +

Namespace that contains various types for manipulation with dates. +More...

+ + + + +

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Namespaces

namespace  marks
 

This namespace holds a enum of various period types like era, year, month, etc..

+

+Classes

class  period_type
 This class holds a type that represents certain period of time like year, hour, second and so on. More...

+Functions

period_type invalid ()
period_type era ()
period_type year ()
period_type extended_year ()
period_type month ()
period_type day ()
period_type day_of_year ()
period_type day_of_week ()
period_type day_of_week_in_month ()
period_type day_of_week_local ()
period_type hour ()
period_type hour_12 ()
period_type am_pm ()
period_type minute ()
period_type second ()
period_type week_of_year ()
period_type week_of_month ()
period_type first_day_of_week ()
date_time_period era (int v)
date_time_period year (int v)
date_time_period extended_year (int v)
date_time_period month (int v)
date_time_period day (int v)
date_time_period day_of_year (int v)
date_time_period day_of_week (int v)
date_time_period day_of_week_in_month (int v)
date_time_period day_of_week_local (int v)
date_time_period hour (int v)
date_time_period hour_12 (int v)
date_time_period am_pm (int v)
date_time_period minute (int v)
date_time_period second (int v)
date_time_period week_of_year (int v)
date_time_period week_of_month (int v)
date_time_period first_day_of_week (int v)
date_time_period january ()
date_time_period february ()
date_time_period march ()
date_time_period april ()
date_time_period may ()
date_time_period june ()
date_time_period july ()
date_time_period august ()
date_time_period september ()
date_time_period october ()
date_time_period november ()
date_time_period december ()
date_time_period sunday ()
date_time_period monday ()
date_time_period tuesday ()
date_time_period wednesday ()
date_time_period thursday ()
date_time_period friday ()
date_time_period saturday ()
date_time_period am ()
date_time_period pm ()
date_time_period operator+ (period::period_type f)
date_time_period operator- (period::period_type f)
template<typename T >
date_time_period operator* (period::period_type f, T v)
template<typename T >
date_time_period operator* (T v, period::period_type f)
template<typename T >
date_time_period operator* (T v, date_time_period f)
template<typename T >
date_time_period operator* (date_time_period f, T v)
int era (date_time const &dt)
int year (date_time const &dt)
int extended_year (date_time const &dt)
int month (date_time const &dt)
int day (date_time const &dt)
int day_of_year (date_time const &dt)
int day_of_week (date_time const &dt)
int day_of_week_in_month (date_time const &dt)
int day_of_week_local (date_time const &dt)
int hour (date_time const &dt)
int hour_12 (date_time const &dt)
int am_pm (date_time const &dt)
int minute (date_time const &dt)
int second (date_time const &dt)
int week_of_year (date_time const &dt)
int week_of_month (date_time const &dt)
int first_day_of_week (date_time const &dt)
int era (date_time_duration const &dt)
int year (date_time_duration const &dt)
int extended_year (date_time_duration const &dt)
int month (date_time_duration const &dt)
int day (date_time_duration const &dt)
int day_of_year (date_time_duration const &dt)
int day_of_week (date_time_duration const &dt)
int day_of_week_in_month (date_time_duration const &dt)
int day_of_week_local (date_time_duration const &dt)
int hour (date_time_duration const &dt)
int hour_12 (date_time_duration const &dt)
int am_pm (date_time_duration const &dt)
int minute (date_time_duration const &dt)
int second (date_time_duration const &dt)
int week_of_year (date_time_duration const &dt)
int week_of_month (date_time_duration const &dt)
int first_day_of_week (date_time_duration const &dt)
+

Detailed Description

+

Namespace that contains various types for manipulation with dates.

+

Function Documentation

+ +
+
+ + + + + + + + +
date_time_period boost::locale::period::am ( )  [inline]
+
+
+

Get predefined constant for AM (Ante Meridiem)

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::am_pm (date_time const &  dt )  [inline]
+
+
+

Extract from date_time numerical value of am or pm marker [0..1]

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::am_pm (date_time_duration const &  dt )  [inline]
+
+
+

Extract from date_time_duration numerical value of duration in am or pm markers

+ +
+
+ +
+
+ + + + + + + + +
period_type boost::locale::period::am_pm ( )  [inline]
+
+
+

Get period_type for: am or pm marker [0..1]

+ +
+
+ +
+
+ + + + + + + + + +
date_time_period boost::locale::period::am_pm (int  v )  [inline]
+
+
+

Get date_time_period for: am or pm marker [0..1]

+ +
+
+ +
+
+ + + + + + + + +
date_time_period boost::locale::period::april ( )  [inline]
+
+
+

Get predefined constant for April

+ +
+
+ +
+
+ + + + + + + + +
date_time_period boost::locale::period::august ( )  [inline]
+
+
+

Get predefined constant for August

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::day (date_time const &  dt )  [inline]
+
+
+

Extract from date_time numerical value of The day of month, calendar specific, in Gregorian [1..31]

+ +
+
+ +
+
+ + + + + + + + + +
date_time_period boost::locale::period::day (int  v )  [inline]
+
+
+

Get date_time_period for: The day of month, calendar specific, in Gregorian [1..31]

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::day (date_time_duration const &  dt )  [inline]
+
+
+

Extract from date_time_duration numerical value of duration in days of month

+ +
+
+ +
+
+ + + + + + + + +
period_type boost::locale::period::day ( )  [inline]
+
+
+

Get period_type for: The day of month, calendar specific, in Gregorian [1..31]

+
Examples:
calendar.cpp.
+
+
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::day_of_week (date_time const &  dt )  [inline]
+
+
+

Extract from date_time numerical value of Day of week, Sunday=1, Monday=2,..., Saturday=7.

+

Note that that updating this value respects local day of week, so for example, If first day of week is Monday and the current day is Tuesday then setting the value to Sunday (1) would forward the date by 5 days forward and not backward by two days as it could be expected if the numbers were taken as is.

+ +
+
+ +
+
+ + + + + + + + +
period_type boost::locale::period::day_of_week ( )  [inline]
+
+
+

Get period_type for: Day of week, Sunday=1, Monday=2,..., Saturday=7.

+

Note that that updating this value respects local day of week, so for example, If first day of week is Monday and the current day is Tuesday then setting the value to Sunday (1) would forward the date by 5 days forward and not backward by two days as it could be expected if the numbers were taken as is.

+
Examples:
calendar.cpp.
+
+
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::day_of_week (date_time_duration const &  dt )  [inline]
+
+
+

Extract from date_time_duration numerical value of duration in days of week

+ +
+
+ +
+
+ + + + + + + + + +
date_time_period boost::locale::period::day_of_week (int  v )  [inline]
+
+
+

Get date_time_period for: Day of week, Sunday=1, Monday=2,..., Saturday=7.

+

Note that that updating this value respects local day of week, so for example, If first day of week is Monday and the current day is Tuesday then setting the value to Sunday (1) would forward the date by 5 days forward and not backward by two days as it could be expected if the numbers were taken as is.

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::day_of_week_in_month (date_time const &  dt )  [inline]
+
+
+

Extract from date_time numerical value of Original number of the day of the week in month. For example 1st Sunday, 2nd Sunday, etc. in Gregorian [1..5]

+ +
+
+ +
+
+ + + + + + + + +
period_type boost::locale::period::day_of_week_in_month ( )  [inline]
+
+
+

Get period_type for: Original number of the day of the week in month. For example 1st Sunday, 2nd Sunday, etc. in Gregorian [1..5]

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::day_of_week_in_month (date_time_duration const &  dt )  [inline]
+
+
+

Extract from date_time_duration numerical value of duration in original number of the day of the week in month

+ +
+
+ +
+
+ + + + + + + + + +
date_time_period boost::locale::period::day_of_week_in_month (int  v )  [inline]
+
+
+

Get date_time_period for: Original number of the day of the week in month. For example 1st Sunday, 2nd Sunday, etc. in Gregorian [1..5]

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::day_of_week_local (date_time const &  dt )  [inline]
+
+
+

Extract from date_time numerical value of Local day of week, for example in France Monday is 1, in US Sunday is 1, [1..7]

+ +
+
+ +
+
+ + + + + + + + +
period_type boost::locale::period::day_of_week_local ( )  [inline]
+
+
+

Get period_type for: Local day of week, for example in France Monday is 1, in US Sunday is 1, [1..7]

+
Examples:
calendar.cpp.
+
+
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::day_of_week_local (date_time_duration const &  dt )  [inline]
+
+
+

Extract from date_time_duration numerical value of duration in local day of week

+ +
+
+ +
+
+ + + + + + + + + +
date_time_period boost::locale::period::day_of_week_local (int  v )  [inline]
+
+
+

Get date_time_period for: Local day of week, for example in France Monday is 1, in US Sunday is 1, [1..7]

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::day_of_year (date_time const &  dt )  [inline]
+
+
+

Extract from date_time numerical value of The number of day in year, starting from 1, in Gregorian [1..366]

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::day_of_year (date_time_duration const &  dt )  [inline]
+
+
+

Extract from date_time_duration numerical value of duration in days of year

+ +
+
+ +
+
+ + + + + + + + +
period_type boost::locale::period::day_of_year ( )  [inline]
+
+
+

Get period_type for: The number of day in year, starting from 1, in Gregorian [1..366]

+ +
+
+ +
+
+ + + + + + + + + +
date_time_period boost::locale::period::day_of_year (int  v )  [inline]
+
+
+

Get date_time_period for: The number of day in year, starting from 1, in Gregorian [1..366]

+ +
+
+ +
+
+ + + + + + + + +
date_time_period boost::locale::period::december ( )  [inline]
+
+
+

Get predefined constant for December

+ +
+
+ +
+
+ + + + + + + + + +
date_time_period boost::locale::period::era (int  v )  [inline]
+
+
+

Get date_time_period for: Era i.e. AC, BC in Gregorian and Julian calendar, range [0,1]

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::era (date_time_duration const &  dt )  [inline]
+
+
+

Extract from date_time_duration numerical value of duration in Era i.e. AC, BC in Gregorian and Julian calendar, range [0,1]

+ +
+
+ +
+
+ + + + + + + + +
period_type boost::locale::period::era ( )  [inline]
+
+
+

Get period_type for: Era i.e. AC, BC in Gregorian and Julian calendar, range [0,1]

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::era (date_time const &  dt )  [inline]
+
+
+

Extract from date_time numerical value of Era i.e. AC, BC in Gregorian and Julian calendar, range [0,1]

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::extended_year (date_time const &  dt )  [inline]
+
+
+

Extract from date_time numerical value of Extended year for Gregorian/Julian calendars, where 1 BC == 0, 2 BC == -1.

+ +
+
+ +
+
+ + + + + + + + +
period_type boost::locale::period::extended_year ( )  [inline]
+
+
+

Get period_type for: Extended year for Gregorian/Julian calendars, where 1 BC == 0, 2 BC == -1.

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::extended_year (date_time_duration const &  dt )  [inline]
+
+
+

Extract from date_time_duration numerical value of duration in extended years (for Gregorian/Julian calendars, where 1 BC == 0, 2 BC == -1).

+ +
+
+ +
+
+ + + + + + + + + +
date_time_period boost::locale::period::extended_year (int  v )  [inline]
+
+
+

Get date_time_period for: Extended year for Gregorian/Julian calendars, where 1 BC == 0, 2 BC == -1.

+ +
+
+ +
+
+ + + + + + + + +
date_time_period boost::locale::period::february ( )  [inline]
+
+
+

Get predefined constant for February

+ +
+
+ +
+
+ + + + + + + + + +
date_time_period boost::locale::period::first_day_of_week (int  v )  [inline]
+
+
+

Get date_time_period for: First day of week, constant, for example Sunday in US = 1, Monday in France = 2

+ +
+
+ +
+
+ + + + + + + + +
period_type boost::locale::period::first_day_of_week ( )  [inline]
+
+
+

Get period_type for: First day of week, constant, for example Sunday in US = 1, Monday in France = 2

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::first_day_of_week (date_time const &  dt )  [inline]
+
+
+

Extract from date_time numerical value of First day of week, constant, for example Sunday in US = 1, Monday in France = 2

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::first_day_of_week (date_time_duration const &  dt )  [inline]
+
+
+

Extract from date_time_duration numerical value of duration in the first day of week

+ +
+
+ +
+
+ + + + + + + + +
date_time_period boost::locale::period::friday ( )  [inline]
+
+
+

Get predefined constant for Friday

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::hour (date_time const &  dt )  [inline]
+
+
+

Extract from date_time numerical value of 24 clock hour [0..23]

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::hour (date_time_duration const &  dt )  [inline]
+
+
+

Extract from date_time_duration numerical value of duration in hours

+ +
+
+ +
+
+ + + + + + + + +
period_type boost::locale::period::hour ( )  [inline]
+
+
+

Get period_type for: 24 clock hour [0..23]

+ +
+
+ +
+
+ + + + + + + + + +
date_time_period boost::locale::period::hour (int  v )  [inline]
+
+
+

Get date_time_period for: 24 clock hour [0..23]

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::hour_12 (date_time const &  dt )  [inline]
+
+
+

Extract from date_time numerical value of 12 clock hour [0..11]

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::hour_12 (date_time_duration const &  dt )  [inline]
+
+
+

Extract from date_time_duration numerical value of duration in 12 clock hours

+ +
+
+ +
+
+ + + + + + + + +
period_type boost::locale::period::hour_12 ( )  [inline]
+
+
+

Get period_type for: 12 clock hour [0..11]

+ +
+
+ +
+
+ + + + + + + + + +
date_time_period boost::locale::period::hour_12 (int  v )  [inline]
+
+
+

Get date_time_period for: 12 clock hour [0..11]

+ +
+
+ +
+
+ + + + + + + + +
period_type boost::locale::period::invalid ( )  [inline]
+
+
+

Get period_type for: special invalid value, should not be used directly

+ +
+
+ +
+
+ + + + + + + + +
date_time_period boost::locale::period::january ( )  [inline]
+
+
+

Get predefined constant for January

+ +
+
+ +
+
+ + + + + + + + +
date_time_period boost::locale::period::july ( )  [inline]
+
+
+

Get predefined constant for July

+ +
+
+ +
+
+ + + + + + + + +
date_time_period boost::locale::period::june ( )  [inline]
+
+
+

Get predefined constant for June

+ +
+
+ +
+
+ + + + + + + + +
date_time_period boost::locale::period::march ( )  [inline]
+
+
+

Get predefined constant for March

+ +
+
+ +
+
+ + + + + + + + +
date_time_period boost::locale::period::may ( )  [inline]
+
+
+

Get predefined constant for May

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::minute (date_time_duration const &  dt )  [inline]
+
+
+

Extract from date_time_duration numerical value of duration in minutes

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::minute (date_time const &  dt )  [inline]
+
+
+

Extract from date_time numerical value of minute [0..59]

+ +
+
+ +
+
+ + + + + + + + +
period_type boost::locale::period::minute ( )  [inline]
+
+
+

Get period_type for: minute [0..59]

+ +
+
+ +
+
+ + + + + + + + + +
date_time_period boost::locale::period::minute (int  v )  [inline]
+
+
+

Get date_time_period for: minute [0..59]

+ +
+
+ +
+
+ + + + + + + + +
date_time_period boost::locale::period::monday ( )  [inline]
+
+
+

Get predefined constant for Monday

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::month (date_time const &  dt )  [inline]
+
+
+

Extract from date_time numerical value of The month of year, calendar specific, in Gregorian [0..11]

+ +
+
+ +
+
+ + + + + + + + + +
date_time_period boost::locale::period::month (int  v )  [inline]
+
+
+

Get date_time_period for: The month of year, calendar specific, in Gregorian [0..11]

+ +
+
+ +
+
+ + + + + + + + +
period_type boost::locale::period::month ( )  [inline]
+
+
+

Get period_type for: The month of year, calendar specific, in Gregorian [0..11]

+
Examples:
calendar.cpp.
+
+
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::month (date_time_duration const &  dt )  [inline]
+
+
+

Extract from date_time_duration numerical value of duration in months

+ +
+
+ +
+
+ + + + + + + + +
date_time_period boost::locale::period::november ( )  [inline]
+
+
+

Get predefined constant for November

+ +
+
+ +
+
+ + + + + + + + +
date_time_period boost::locale::period::october ( )  [inline]
+
+
+

Get predefined constant for October

+ +
+
+ +
+
+
+template<typename T >
+ + + + + + + + + + + + + + + + + + +
date_time_period boost::locale::period::operator* ( v,
date_time_period  f 
)
+
+
+

Create date_time_period of type f with value v.

+ +
+
+ +
+
+
+template<typename T >
+ + + + + + + + + + + + + + + + + + +
date_time_period boost::locale::period::operator* (period::period_type  f,
v 
)
+
+
+

Create date_time_period of type f with value v.

+ +
+
+ +
+
+
+template<typename T >
+ + + + + + + + + + + + + + + + + + +
date_time_period boost::locale::period::operator* ( v,
period::period_type  f 
)
+
+
+

Create date_time_period of type f with value v.

+ +
+
+ +
+
+
+template<typename T >
+ + + + + + + + + + + + + + + + + + +
date_time_period boost::locale::period::operator* (date_time_period  f,
v 
)
+
+
+

Create date_time_period of type f with value v.

+ +
+
+ +
+
+ + + + + + + + + +
date_time_period boost::locale::period::operator+ (period::period_type  f )  [inline]
+
+
+

convert period_type to date_time_period(f,1)

+ +
+
+ +
+
+ + + + + + + + + +
date_time_period boost::locale::period::operator- (period::period_type  f )  [inline]
+
+
+

convert period_type to date_time_period(f,-1)

+ +
+
+ +
+
+ + + + + + + + +
date_time_period boost::locale::period::pm ( )  [inline]
+
+
+

Get predefined constant for PM (Post Meridiem)

+ +
+
+ +
+
+ + + + + + + + +
date_time_period boost::locale::period::saturday ( )  [inline]
+
+
+

Get predefined constant for Saturday

+ +
+
+ +
+
+ + + + + + + + + +
date_time_period boost::locale::period::second (int  v )  [inline]
+
+
+

Get date_time_period for: second [0..59]

+ +
+
+ +
+
+ + + + + + + + +
period_type boost::locale::period::second ( )  [inline]
+
+
+

Get period_type for: second [0..59]

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::second (date_time const &  dt )  [inline]
+
+
+

Extract from date_time numerical value of second [0..59]

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::second (date_time_duration const &  dt )  [inline]
+
+
+

Extract from date_time_duration numerical value of duration in seconds

+ +
+
+ +
+
+ + + + + + + + +
date_time_period boost::locale::period::september ( )  [inline]
+
+
+

Get predefined constant for September

+ +
+
+ +
+
+ + + + + + + + +
date_time_period boost::locale::period::sunday ( )  [inline]
+
+
+

Get predefined constant for Sunday

+ +
+
+ +
+
+ + + + + + + + +
date_time_period boost::locale::period::thursday ( )  [inline]
+
+
+

Get predefined constant for Thursday

+ +
+
+ +
+
+ + + + + + + + +
date_time_period boost::locale::period::tuesday ( )  [inline]
+
+
+

Get predefined constant for Tuesday

+ +
+
+ +
+
+ + + + + + + + +
date_time_period boost::locale::period::wednesday ( )  [inline]
+
+
+

Get predefined constant for Wednesday

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::week_of_month (date_time const &  dt )  [inline]
+
+
+

Extract from date_time numerical value of The week number within current month

+ +
+
+ +
+
+ + + + + + + + + +
date_time_period boost::locale::period::week_of_month (int  v )  [inline]
+
+
+

Get date_time_period for: The week number within current month

+ +
+
+ +
+
+ + + + + + + + +
period_type boost::locale::period::week_of_month ( )  [inline]
+
+
+

Get period_type for: The week number within current month

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::week_of_month (date_time_duration const &  dt )  [inline]
+
+
+

Extract from date_time_duration numerical value of duration in The week number within current month

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::week_of_year (date_time_duration const &  dt )  [inline]
+
+
+

Extract from date_time_duration numerical value of duration in the week number in the year

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::week_of_year (date_time const &  dt )  [inline]
+
+
+

Extract from date_time numerical value of The week number in the year

+ +
+
+ +
+
+ + + + + + + + + +
date_time_period boost::locale::period::week_of_year (int  v )  [inline]
+
+
+

Get date_time_period for: The week number in the year

+ +
+
+ +
+
+ + + + + + + + +
period_type boost::locale::period::week_of_year ( )  [inline]
+
+
+

Get period_type for: The week number in the year

+ +
+
+ +
+
+ + + + + + + + + +
date_time_period boost::locale::period::year (int  v )  [inline]
+
+
+

Get date_time_period for: Year, it is calendar specific, for example 2011 in Gregorian calendar.

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::year (date_time_duration const &  dt )  [inline]
+
+
+

Extract from date_time_duration numerical value of duration in years

+ +
+
+ +
+
+ + + + + + + + + +
int boost::locale::period::year (date_time const &  dt )  [inline]
+
+
+

Extract from date_time numerical value of Year, it is calendar specific, for example 2011 in Gregorian calendar.

+ +
+
+ +
+
+ + + + + + + + +
period_type boost::locale::period::year ( )  [inline]
+
+
+

Get period_type for: Year, it is calendar specific, for example 2011 in Gregorian calendar.

+
Examples:
calendar.cpp.
+
+
+
+
+ + + diff --git a/doc/html/namespaceboost_1_1locale_1_1period_1_1marks.html b/doc/html/namespaceboost_1_1locale_1_1period_1_1marks.html new file mode 100644 index 0000000..63b9881 --- /dev/null +++ b/doc/html/namespaceboost_1_1locale_1_1period_1_1marks.html @@ -0,0 +1,197 @@ + + + + +Boost.Locale: boost::locale::period::marks Namespace Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::period::marks Namespace Reference

+
+
+ +

This namespace holds a enum of various period types like era, year, month, etc.. +More...

+ + + + +

+Enumerations

enum  period_mark {
+  invalid, +era, +year, +extended_year, +
+  month, +day, +day_of_year, +day_of_week, +
+  day_of_week_in_month, +day_of_week_local, +hour, +hour_12, +
+  am_pm, +minute, +second, +week_of_year, +
+  week_of_month, +first_day_of_week +
+ }
 

the type that defines a flag that holds a period identifier

+ More...
+

Detailed Description

+

This namespace holds a enum of various period types like era, year, month, etc..

+

Enumeration Type Documentation

+ +
+ +
+ +

the type that defines a flag that holds a period identifier

+
Enumerator:
+ + + + + + + + + + + + + + + + + + +
invalid  +

Special invalid value, should not be used directly.

+
era  +

Era i.e. AC, BC in Gregorian and Julian calendar, range [0,1].

+
year  +

Year, it is calendar specific, for example 2011 in Gregorian calendar.

+
extended_year  +

Extended year for Gregorian/Julian calendars, where 1 BC == 0, 2 BC == -1.

+
month  +

The month of year, calendar specific, in Gregorian [0..11].

+
day  +

The day of month, calendar specific, in Gregorian [1..31].

+
day_of_year  +

The number of day in year, starting from 1, in Gregorian [1..366].

+
day_of_week  +

Day of week, Sunday=1, Monday=2,..., Saturday=7. Note that that updating this value respects local day of week, so for example, If first day of week is Monday and the current day is Tuesday then setting the value to Sunday (1) would forward the date by 5 days forward and not backward by two days as it could be expected if the numbers were taken as is.

+
day_of_week_in_month  +

Original number of the day of the week in month. For example 1st Sunday, 2nd Sunday, etc. in Gregorian [1..5]

+
day_of_week_local  +

Local day of week, for example in France Monday is 1, in US Sunday is 1, [1..7].

+
hour  +

24 clock hour [0..23]

+
hour_12  +

12 clock hour [0..11]

+
am_pm  +

am or pm marker [0..1]

+
minute  +

minute [0..59]

+
second  +

second [0..59]

+
week_of_year  +

The week number in the year.

+
week_of_month  +

The week number within current month.

+
first_day_of_week  +

First day of week, constant, for example Sunday in US = 1, Monday in France = 2.

+
+
+
+ +
+
+
+ + + diff --git a/doc/html/namespaceboost_1_1locale_1_1time__zone.html b/doc/html/namespaceboost_1_1locale_1_1time__zone.html new file mode 100644 index 0000000..90cfd87 --- /dev/null +++ b/doc/html/namespaceboost_1_1locale_1_1time__zone.html @@ -0,0 +1,138 @@ + + + + +Boost.Locale: boost::locale::time_zone Namespace Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::time_zone Namespace Reference
+ +[Date, Time, Timezone and Calendar manipulations] +

+
+
+ +

namespace that holds functions for operating with global time zone +More...

+ + + + +

+Functions

std::string global ()
std::string global (std::string const &new_tz)
+

Detailed Description

+

namespace that holds functions for operating with global time zone

+

Function Documentation

+ +
+
+ + + + + + + + +
std::string boost::locale::time_zone::global ( ) 
+
+
+

Get global time zone identifier. If empty, system time zone is used

+ +
+
+ +
+
+ + + + + + + + + +
std::string boost::locale::time_zone::global (std::string const &  new_tz ) 
+
+
+

Set global time zone identifier returning previous one. If empty, system time zone is used

+ +
+
+
+ + + diff --git a/doc/html/namespaceboost_1_1locale_1_1util.html b/doc/html/namespaceboost_1_1locale_1_1util.html new file mode 100644 index 0000000..f5d6986 --- /dev/null +++ b/doc/html/namespaceboost_1_1locale_1_1util.html @@ -0,0 +1,237 @@ + + + + +Boost.Locale: boost::locale::util Namespace Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::util Namespace Reference

+
+
+ +

This namespace provides various utility function useful for Boost.Locale backends implementations. +More...

+ + + + + + + + + + + + +

+Classes

class  base_converter
 This class represent a simple stateless converter from UCS-4 and to UCS-4 for each single code point. More...

+Functions

std::string get_system_locale (bool use_utf8_on_windows=false)
 Return default system locale name in POSIX format.
std::locale create_info (std::locale const &in, std::string const &name)
 Installs information facet to locale in based on locale name name.
std::auto_ptr< base_convertercreate_utf8_converter ()
std::auto_ptr< base_convertercreate_simple_converter (std::string const &encoding)
std::locale create_codecvt (std::locale const &in, std::auto_ptr< base_converter > cvt, character_facet_type type)
+

Detailed Description

+

This namespace provides various utility function useful for Boost.Locale backends implementations.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::locale boost::locale::util::create_codecvt (std::locale const &  in,
std::auto_ptr< base_converter >  cvt,
character_facet_type  type 
)
+
+
+

Install codecvt facet into locale in and return new locale that is based on in and uses new facet.

+

codecvt facet would convert between narrow and wide/char16_t/char32_t encodings using cvt converter. If cvt is null pointer, always failure conversion would be used that fails on every first input or output.

+

Note: the codecvt facet handles both UTF-16 and UTF-32 wide encodings, it knows to break and join Unicode code-points above 0xFFFF to and from surrogate pairs correctly. cvt should be unaware of wide encoding type

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
std::locale boost::locale::util::create_info (std::locale const &  in,
std::string const &  name 
)
+
+
+ +

Installs information facet to locale in based on locale name name.

+

This function installs boost::locale::info facet into the locale in and returns newly created locale.

+

Note: all information is based only on parsing of string name;

+

The name has following format: language[_COUNTRY][.encoding][@variant] Where language is ISO-639 language code like "en" or "ru", COUNTRY is ISO-3166 country identifier like "US" or "RU". the Encoding is a charracter set name like UTF-8 or ISO-8859-1. Variant is backend specific variant like euro or calendar=hebrew.

+

If some parameters are missing they are specified as blanks, default encoding is assumed to be US-ASCII and missing language is assumed to be "C"

+ +
+
+ +
+
+ + + + + + + + + +
std::auto_ptr<base_converter> boost::locale::util::create_simple_converter (std::string const &  encoding ) 
+
+
+

This function creates a base_converter that can be used for conversion between single byte character encodings like ISO-8859-1, koi8-r, windows-1255 and Unicode code points,

+

If encoding is not supported, empty pointer is returned. You should check if std::auto_ptr<base_converter>::get() != 0

+ +
+
+ +
+
+ + + + + + + + +
std::auto_ptr<base_converter> boost::locale::util::create_utf8_converter ( ) 
+
+
+

This function creates a base_converter that can be used for conversion between UTF-8 and unicode code points

+ +
+
+ +
+
+ + + + + + + + + +
std::string boost::locale::util::get_system_locale (bool  use_utf8_on_windows = false ) 
+
+
+ +

Return default system locale name in POSIX format.

+

This function tries to detect the locale using, LC_CTYPE, LC_ALL and LANG environment variables in this order and if all of them unset, in POSIX platforms it returns "C"

+

On Windows additionally to check the above environment variables, this function tries to creates locale name from ISO-339 and ISO-3199 country codes defined for user default locale. If use_utf8_on_windows is true it sets the encoding to UTF-8, otherwise, if system locale supports ANSI code-page it defines the ANSI encoding like windows-1252, otherwise it fall-backs to UTF-8 encoding if ANSI code-page is not available.

+ +
+
+
+ + + diff --git a/doc/html/namespacemembers.html b/doc/html/namespacemembers.html new file mode 100644 index 0000000..28142ac --- /dev/null +++ b/doc/html/namespacemembers.html @@ -0,0 +1,132 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- a -

+
+ + + diff --git a/doc/html/namespacemembers_0x62.html b/doc/html/namespacemembers_0x62.html new file mode 100644 index 0000000..70e978b --- /dev/null +++ b/doc/html/namespacemembers_0x62.html @@ -0,0 +1,125 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- b -

+
+ + + diff --git a/doc/html/namespacemembers_0x63.html b/doc/html/namespacemembers_0x63.html new file mode 100644 index 0000000..40da0b1 --- /dev/null +++ b/doc/html/namespacemembers_0x63.html @@ -0,0 +1,191 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- c -

+
+ + + diff --git a/doc/html/namespacemembers_0x64.html b/doc/html/namespacemembers_0x64.html new file mode 100644 index 0000000..de6a206 --- /dev/null +++ b/doc/html/namespacemembers_0x64.html @@ -0,0 +1,186 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- d -

+
+ + + diff --git a/doc/html/namespacemembers_0x65.html b/doc/html/namespacemembers_0x65.html new file mode 100644 index 0000000..13abed1 --- /dev/null +++ b/doc/html/namespacemembers_0x65.html @@ -0,0 +1,121 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- e -

+
+ + + diff --git a/doc/html/namespacemembers_0x66.html b/doc/html/namespacemembers_0x66.html new file mode 100644 index 0000000..7b8bc62 --- /dev/null +++ b/doc/html/namespacemembers_0x66.html @@ -0,0 +1,138 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- f -

+
+ + + diff --git a/doc/html/namespacemembers_0x67.html b/doc/html/namespacemembers_0x67.html new file mode 100644 index 0000000..2458b25 --- /dev/null +++ b/doc/html/namespacemembers_0x67.html @@ -0,0 +1,125 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- g -

+
+ + + diff --git a/doc/html/namespacemembers_0x68.html b/doc/html/namespacemembers_0x68.html new file mode 100644 index 0000000..93172fd --- /dev/null +++ b/doc/html/namespacemembers_0x68.html @@ -0,0 +1,121 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- h -

+
+ + + diff --git a/doc/html/namespacemembers_0x69.html b/doc/html/namespacemembers_0x69.html new file mode 100644 index 0000000..1fe26c7 --- /dev/null +++ b/doc/html/namespacemembers_0x69.html @@ -0,0 +1,123 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- i -

+
+ + + diff --git a/doc/html/namespacemembers_0x6a.html b/doc/html/namespacemembers_0x6a.html new file mode 100644 index 0000000..51b93fe --- /dev/null +++ b/doc/html/namespacemembers_0x6a.html @@ -0,0 +1,122 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- j -

+
+ + + diff --git a/doc/html/namespacemembers_0x6c.html b/doc/html/namespacemembers_0x6c.html new file mode 100644 index 0000000..5dc3462 --- /dev/null +++ b/doc/html/namespacemembers_0x6c.html @@ -0,0 +1,134 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- l -

+
+ + + diff --git a/doc/html/namespacemembers_0x6d.html b/doc/html/namespacemembers_0x6d.html new file mode 100644 index 0000000..f0eb3dd --- /dev/null +++ b/doc/html/namespacemembers_0x6d.html @@ -0,0 +1,141 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- m -

+
+ + + diff --git a/doc/html/namespacemembers_0x6e.html b/doc/html/namespacemembers_0x6e.html new file mode 100644 index 0000000..c2747bf --- /dev/null +++ b/doc/html/namespacemembers_0x6e.html @@ -0,0 +1,155 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- n -

+
+ + + diff --git a/doc/html/namespacemembers_0x6f.html b/doc/html/namespacemembers_0x6f.html new file mode 100644 index 0000000..6fa632c --- /dev/null +++ b/doc/html/namespacemembers_0x6f.html @@ -0,0 +1,156 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- o -

+
+ + + diff --git a/doc/html/namespacemembers_0x70.html b/doc/html/namespacemembers_0x70.html new file mode 100644 index 0000000..6f1b70b --- /dev/null +++ b/doc/html/namespacemembers_0x70.html @@ -0,0 +1,140 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- p -

+
+ + + diff --git a/doc/html/namespacemembers_0x72.html b/doc/html/namespacemembers_0x72.html new file mode 100644 index 0000000..5893b46 --- /dev/null +++ b/doc/html/namespacemembers_0x72.html @@ -0,0 +1,116 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- r -

+
+ + + diff --git a/doc/html/namespacemembers_0x73.html b/doc/html/namespacemembers_0x73.html new file mode 100644 index 0000000..0844af3 --- /dev/null +++ b/doc/html/namespacemembers_0x73.html @@ -0,0 +1,165 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- s -

+
+ + + diff --git a/doc/html/namespacemembers_0x74.html b/doc/html/namespacemembers_0x74.html new file mode 100644 index 0000000..34e31ac --- /dev/null +++ b/doc/html/namespacemembers_0x74.html @@ -0,0 +1,158 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- t -

+
+ + + diff --git a/doc/html/namespacemembers_0x75.html b/doc/html/namespacemembers_0x75.html new file mode 100644 index 0000000..6d4588b --- /dev/null +++ b/doc/html/namespacemembers_0x75.html @@ -0,0 +1,176 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- u -

+
+ + + diff --git a/doc/html/namespacemembers_0x76.html b/doc/html/namespacemembers_0x76.html new file mode 100644 index 0000000..ffa3305 --- /dev/null +++ b/doc/html/namespacemembers_0x76.html @@ -0,0 +1,116 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- v -

+
+ + + diff --git a/doc/html/namespacemembers_0x77.html b/doc/html/namespacemembers_0x77.html new file mode 100644 index 0000000..e350a8c --- /dev/null +++ b/doc/html/namespacemembers_0x77.html @@ -0,0 +1,188 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- w -

+
+ + + diff --git a/doc/html/namespacemembers_0x79.html b/doc/html/namespacemembers_0x79.html new file mode 100644 index 0000000..95e33b2 --- /dev/null +++ b/doc/html/namespacemembers_0x79.html @@ -0,0 +1,117 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- y -

+
+ + + diff --git a/doc/html/namespacemembers_enum.html b/doc/html/namespacemembers_enum.html new file mode 100644 index 0000000..d66daeb --- /dev/null +++ b/doc/html/namespacemembers_enum.html @@ -0,0 +1,106 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+ + + diff --git a/doc/html/namespacemembers_eval.html b/doc/html/namespacemembers_eval.html new file mode 100644 index 0000000..e2a2030 --- /dev/null +++ b/doc/html/namespacemembers_eval.html @@ -0,0 +1,256 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- a -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- f -

+ + +

- h -

+ + +

- i -

+ + +

- l -

+ + +

- m -

+ + +

- n -

+ + +

- s -

+ + +

- t -

+ + +

- w -

+ + +

- y -

+
+ + + diff --git a/doc/html/namespacemembers_func.html b/doc/html/namespacemembers_func.html new file mode 100644 index 0000000..6942754 --- /dev/null +++ b/doc/html/namespacemembers_func.html @@ -0,0 +1,123 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- a -

+
+ + + diff --git a/doc/html/namespacemembers_func_0x62.html b/doc/html/namespacemembers_func_0x62.html new file mode 100644 index 0000000..05ba750 --- /dev/null +++ b/doc/html/namespacemembers_func_0x62.html @@ -0,0 +1,117 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- b -

+
+ + + diff --git a/doc/html/namespacemembers_func_0x63.html b/doc/html/namespacemembers_func_0x63.html new file mode 100644 index 0000000..d381db7 --- /dev/null +++ b/doc/html/namespacemembers_func_0x63.html @@ -0,0 +1,138 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- c -

+
+ + + diff --git a/doc/html/namespacemembers_func_0x64.html b/doc/html/namespacemembers_func_0x64.html new file mode 100644 index 0000000..bbd51dd --- /dev/null +++ b/doc/html/namespacemembers_func_0x64.html @@ -0,0 +1,165 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- d -

+
+ + + diff --git a/doc/html/namespacemembers_func_0x65.html b/doc/html/namespacemembers_func_0x65.html new file mode 100644 index 0000000..02ab3c4 --- /dev/null +++ b/doc/html/namespacemembers_func_0x65.html @@ -0,0 +1,117 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- e -

+
+ + + diff --git a/doc/html/namespacemembers_func_0x66.html b/doc/html/namespacemembers_func_0x66.html new file mode 100644 index 0000000..ab4d939 --- /dev/null +++ b/doc/html/namespacemembers_func_0x66.html @@ -0,0 +1,129 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- f -

+
+ + + diff --git a/doc/html/namespacemembers_func_0x67.html b/doc/html/namespacemembers_func_0x67.html new file mode 100644 index 0000000..5ac756e --- /dev/null +++ b/doc/html/namespacemembers_func_0x67.html @@ -0,0 +1,123 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- g -

+
+ + + diff --git a/doc/html/namespacemembers_func_0x68.html b/doc/html/namespacemembers_func_0x68.html new file mode 100644 index 0000000..8dbce88 --- /dev/null +++ b/doc/html/namespacemembers_func_0x68.html @@ -0,0 +1,117 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- h -

+
+ + + diff --git a/doc/html/namespacemembers_func_0x69.html b/doc/html/namespacemembers_func_0x69.html new file mode 100644 index 0000000..9bdce93 --- /dev/null +++ b/doc/html/namespacemembers_func_0x69.html @@ -0,0 +1,114 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- i -

+
+ + + diff --git a/doc/html/namespacemembers_func_0x6a.html b/doc/html/namespacemembers_func_0x6a.html new file mode 100644 index 0000000..49fc2a6 --- /dev/null +++ b/doc/html/namespacemembers_func_0x6a.html @@ -0,0 +1,120 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- j -

+
+ + + diff --git a/doc/html/namespacemembers_func_0x6c.html b/doc/html/namespacemembers_func_0x6c.html new file mode 100644 index 0000000..a45aefc --- /dev/null +++ b/doc/html/namespacemembers_func_0x6c.html @@ -0,0 +1,114 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- l -

+
+ + + diff --git a/doc/html/namespacemembers_func_0x6d.html b/doc/html/namespacemembers_func_0x6d.html new file mode 100644 index 0000000..3702f66 --- /dev/null +++ b/doc/html/namespacemembers_func_0x6d.html @@ -0,0 +1,126 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- m -

+
+ + + diff --git a/doc/html/namespacemembers_func_0x6e.html b/doc/html/namespacemembers_func_0x6e.html new file mode 100644 index 0000000..434d80d --- /dev/null +++ b/doc/html/namespacemembers_func_0x6e.html @@ -0,0 +1,126 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- n -

+
+ + + diff --git a/doc/html/namespacemembers_func_0x6f.html b/doc/html/namespacemembers_func_0x6f.html new file mode 100644 index 0000000..d8030cb --- /dev/null +++ b/doc/html/namespacemembers_func_0x6f.html @@ -0,0 +1,154 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- o -

+
+ + + diff --git a/doc/html/namespacemembers_func_0x70.html b/doc/html/namespacemembers_func_0x70.html new file mode 100644 index 0000000..061901c --- /dev/null +++ b/doc/html/namespacemembers_func_0x70.html @@ -0,0 +1,123 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- p -

+
+ + + diff --git a/doc/html/namespacemembers_func_0x73.html b/doc/html/namespacemembers_func_0x73.html new file mode 100644 index 0000000..e8763d6 --- /dev/null +++ b/doc/html/namespacemembers_func_0x73.html @@ -0,0 +1,129 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- s -

+
+ + + diff --git a/doc/html/namespacemembers_func_0x74.html b/doc/html/namespacemembers_func_0x74.html new file mode 100644 index 0000000..165e4f0 --- /dev/null +++ b/doc/html/namespacemembers_func_0x74.html @@ -0,0 +1,153 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- t -

+
+ + + diff --git a/doc/html/namespacemembers_func_0x75.html b/doc/html/namespacemembers_func_0x75.html new file mode 100644 index 0000000..cef2c1f --- /dev/null +++ b/doc/html/namespacemembers_func_0x75.html @@ -0,0 +1,114 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- u -

+
+ + + diff --git a/doc/html/namespacemembers_func_0x77.html b/doc/html/namespacemembers_func_0x77.html new file mode 100644 index 0000000..39c85f2 --- /dev/null +++ b/doc/html/namespacemembers_func_0x77.html @@ -0,0 +1,120 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- w -

+
+ + + diff --git a/doc/html/namespacemembers_func_0x79.html b/doc/html/namespacemembers_func_0x79.html new file mode 100644 index 0000000..15c357f --- /dev/null +++ b/doc/html/namespacemembers_func_0x79.html @@ -0,0 +1,114 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- y -

+
+ + + diff --git a/doc/html/namespacemembers_type.html b/doc/html/namespacemembers_type.html new file mode 100644 index 0000000..7299cd2 --- /dev/null +++ b/doc/html/namespacemembers_type.html @@ -0,0 +1,264 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- c -

+ + +

- f -

+ + +

- i -

+ + +

- l -

+ + +

- m -

+ + +

- r -

+ + +

- s -

+ + +

- u -

+ + +

- w -

+
+ + + diff --git a/doc/html/namespacemembers_vars.html b/doc/html/namespacemembers_vars.html new file mode 100644 index 0000000..744c68d --- /dev/null +++ b/doc/html/namespacemembers_vars.html @@ -0,0 +1,265 @@ + + + + +Boost.Locale: Class Members + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+  + +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- f -

+ + +

- i -

+ + +

- l -

+ + +

- m -

+ + +

- n -

+ + +

- p -

+ + +

- s -

+ + +

- w -

+
+ + + diff --git a/doc/html/namespaces.html b/doc/html/namespaces.html new file mode 100644 index 0000000..5c6a98e --- /dev/null +++ b/doc/html/namespaces.html @@ -0,0 +1,89 @@ + + + + +Boost.Locale: Namespace Index + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Namespace List

+
+
+Here is a list of all documented namespaces with brief descriptions: + + + + + + + + + + +
boost::localeThis is the main namespace that encloses all localization classes
boost::locale::asThis namespace includes all manipulators that can be used on IO streams
boost::locale::boundaryThis namespae contains all operations required for boundary analysis of text
boost::locale::convNamespace that contains all functions related to character set conversion
boost::locale::flagsThis namespace holds additional formatting flags that can be set using ios_info
boost::locale::gnu_gettextThis namespace holds classes that provide GNU Gettext message catalogs support
boost::locale::periodNamespace that contains various types for manipulation with dates
boost::locale::period::marksThis namespace holds a enum of various period types like era, year, month, etc.
boost::locale::time_zoneNamespace that holds functions for operating with global time zone
boost::locale::utilThis namespace provides various utility function useful for Boost.Locale backends implementations
+
+ + + diff --git a/doc/html/nav_f.png b/doc/html/nav_f.png new file mode 100644 index 0000000..1b07a16 Binary files /dev/null and b/doc/html/nav_f.png differ diff --git a/doc/html/nav_h.png b/doc/html/nav_h.png new file mode 100644 index 0000000..01f5fa6 Binary files /dev/null and b/doc/html/nav_h.png differ diff --git a/doc/html/open.png b/doc/html/open.png new file mode 100644 index 0000000..7b35d2c Binary files /dev/null and b/doc/html/open.png differ diff --git a/doc/html/rationale.html b/doc/html/rationale.html new file mode 100644 index 0000000..586594e --- /dev/null +++ b/doc/html/rationale.html @@ -0,0 +1,231 @@ + + + + +Boost.Locale: Design Rationale + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Design Rationale

+
+
+ +

+Why is it needed?

+

Why do we need a localization library, when standard C++ facets (should) provide most of the required functionality:

+
    +
  • Case conversion is done using the std::ctype facet
  • +
  • Collation is supported by std::collate and has nice integration with std::locale
  • +
  • There are std::num_put , std::num_get , std::money_put , std::money_get , std::time_put and std::time_get for numbers, time, and currency formatting and parsing.
  • +
  • There is a std::messages class that supports localized message formatting.
  • +
+

So why do we need such library if we have all the functionality within the standard library?

+

Almost every(!) facet has design flaws:

+
    +
  • std::collate supports only one level of collation, not allowing you to choose whether case- or accent-sensitive comparisons should be performed.
  • +
+
    +
  • std::ctype, which is responsible for case conversion, assumes that all conversions can be done on a per-character basis. This is probably correct for many languages but it isn't correct in general.
    +
      +
    1. Case conversion may change a string's length. For example, the German word "grüßen" should be converted to "GRÜSSEN" in upper case: the letter "ß" should be converted to "SS", but the toupper function works on a single-character basis.
    2. +
    3. Case conversion is context-sensitive. For example, the Greek word "ὈΔΥΣΣΕΎΣ" should be converted to "ὀδυσσεύς", where the Greek letter "Σ" is converted to "σ" or to "ς", depending on its position in the word.
    4. +
    5. Case conversion cannot assume that a character is a single code point, which is incorrect for both the UTF-8 and UTF-16 encodings, where individual code-points are represented by up to 4 char 's or two wchar_t 's on the Windows platform. This makes std::ctype totally useless with these encodings.
    6. +
    +
  • +
  • std::numpunct and std::moneypunct do not specify the code points for digit representation at all, so they cannot format numbers with the digits used under Arabic locales. For example, the number "103" is expected to be displayed as "١٠٣" in the ar_EG locale.
    + std::numpunct and std::moneypunct assume that the thousands separator is a single character. This is untrue for the UTF-8 encoding where only Unicode 0-0x7F range can be represented as a single character. As a result, localized numbers can't be represented correctly under locales that use the Unicode "EN SPACE" character for the thousands separator, such as Russian.
    + This actually causes real problems under GCC and SunStudio compilers, where formatting numbers under a Russian locale creates invalid UTF-8 sequences.
  • +
  • std::time_put and std::time_get have several flaws:
      +
    1. They assume that the calendar is always Gregorian, by using std::tm for time representation, ignoring the fact that in many countries dates may be displayed using different calendars.
    2. +
    3. They always use a global time zone, not allowing specification of the time zone for formatting. The standard std::tm doesn't even include a timezone field at all.
    4. +
    5. std::time_get is not symmetric with std::time_put, so you cannot parse dates and times created with std::time_put . (This issue is addressed in C++0x and some STL implementation like the Apache standard C++ library.)
    6. +
    +
  • +
  • std::messages does not provide support for plural forms, making it impossible to correctly localize such simple strings as "There are X files in the directory".
  • +
+

Also, many features are not really supported by std::locale at all: timezones (as mentioned above), text boundary analysis, number spelling, and many others. So it is clear that the standard C++ locales are problematic for real-world applications.

+

+Why use an ICU wrapper instead of ICU?

+

ICU is a very good localization library, but it has several serious flaws:

+
    +
  • It is absolutely unfriendly to C++ developers. It ignores popular C++ idioms (the STL, RTTI, exceptions, etc), instead mostly mimicking the Java API.
  • +
  • It provides support for only one kind of string, UTF-16, when some users may want other Unicode encodings. For example, for XML or HTML processing UTF-8 is much more convenient and UTF-32 easier to use. Also there is no support for "narrow" encodings that are still very popular, such as the ISO-8859 encodings.
  • +
+

For example: Boost.Locale provides direct integration with iostream allowing a more natural way of data formatting. For example:

+
    cout << "You have "<<as::currency << 134.45 << " in your account as of "<<as::datetime << std::time(0) << endl;
+

+Why an ICU wrapper and not an implementation-from-scratch?

+

ICU is one of the best localization/Unicode libraries available. It consists of about half a million lines of well-tested, production-proven source code that today provides state-of-the art localization tools.

+

Reimplementing of even a small part of ICU's abilities is an infeasible project which would require many man-years. So the question is not whether we need to reimplement the Unicode and localization algorithms from scratch, but "Do we need a good +localization library in Boost?"

+

Thus Boost.Locale wraps ICU with a modern C++ interface, allowing future reimplementation of parts with better alternatives, but bringing localization support to Boost today and not in the not-so-near-if-at-all future.

+

+Why is the ICU API not exposed to the user?

+

Yes, the entire ICU API is hidden behind opaque pointers and users have no access to it. This is done for several reasons:

+
    +
  • At some point, better localization tools may be accepted by future upcoming C++ standards, so they may not use ICU directly.
  • +
  • At some point, it should be possible to switch the underlying localization engine to something else, maybe the native operating system API or some other toolkit such as GLib or Qt that provides similar functionality.
  • +
  • Not all localization is done within ICU. For example, message formatting uses GNU Gettext message catalogs. In the future more functionality may be reimplemented directly in the Boost.Locale library.
  • +
  • Boost.Locale was designed with ABI stability in mind, as this library is being developed not only for Boost but also for the needs of the CppCMS C++ Web framework.
  • +
+

+Why use GNU Gettext catalogs for message formatting?

+

There are many available localization formats. The most popular so far are OASIS XLIFF, GNU gettext po/mo files, POSIX catalogs, Qt ts/tm files, Java properties, and Windows resources. However, the last three are useful only in their specific areas, and POSIX catalogs are too simple and limited, so there are only two reasonable options:

+
    +
  1. Standard localization format OASIS XLIFF.
  2. +
  3. GNU Gettext binary catalogs.
  4. +
+

The first one generally seems like a more correct localization solution, but it requires XML parsing for loading documents, it is very complicated format, and even ICU requires preliminary compilation of it into ICU resource bundles.

+

On the other hand:

+
    +
  • GNU Gettext binary catalogs have a very simple, robust and yet very useful file format.
  • +
  • It is at present the most popular and de-facto standard localization format (at least in the Open Source world).
  • +
  • It has very simple and powerful support for plural forms.
  • +
  • It uses the original English text as the key, making the process of internationalization much easier because at least one basic translation is always available.
  • +
  • There are many tools for editing and managing gettext catalogs, such as Poedit, kbabel etc.
  • +
+

So, even though the GNU Gettext mo catalog format is not an officially approved file format:

+
    +
  • It is a de-facto standard and the most popular one.
  • +
  • Its implementation is much easier and does not require XML parsing and validation.
  • +
+
Note:
Boost.Locale does not use any of the GNU Gettext code, it just reimplements the tool for reading and using mo-files, eliminating the biggest GNU Gettext flaw at present -- thread safety when using multiple locales.
+

+Why is a plain number used for the representation of a date-time, instead of a Boost.DateTime date or Boost.DateTime ptime?

+

There are several reasons:

+
    +
  1. A Gregorian Date by definition can't be used to represent locale-independent dates, because not all calendars are Gregorian.
  2. +
  3. ptime -- definitely could be used, but it has several problems:
    +
      +
    • It is created in GMT or Local time clock, when `time()` gives a representation that is independent of time zones (usually GMT time), and only later should it be represented in a time zone that the user requests.
      + The timezone is not a property of time itself, but it is rather a property of time formatting.
      +
    • +
    • ptime already defines operator<< and operator>> for time formatting and parsing.
    • +
    • The existing facets for ptime formatting and parsing were not designed in a way that the user can override. The major formatting and parsing functions are not virtual. This makes it impossible to reimplement the formatting and parsing functions of ptime unless the developers of the Boost.DateTime library decide to change them.
      + Also, the facets of ptime are not "correctly" designed in terms of division of formatting information and locale information. Formatting information should be stored within std::ios_base and information about locale-specific formatting should be stored in the facet itself.
      + The user of the library should not have to create new facets to change simple formatting information like "display only + the date" or "display both date and time."
    • +
    +
  4. +
+

Thus, at this point, ptime is not supported for formatting localized dates and times.

+

+Why are POSIX locale names used and not something like the BCP-47 IETF language tag?

+

There are several reasons:

+
    +
  • POSIX locale names have a very important feature: character encoding. When you specify for example fr-FR, you do not actually know how the text should be encoded -- UTF-8, ISO-8859-1, ISO-8859-15 or maybe Windows-1252. This may vary between different operating systems and depends on the current installation. So it is critical to provide all the required information.
  • +
  • ICU fully understands POSIX locales and knows how to treat them correctly.
  • +
  • They are native locale names for most operating system APIs (with the exception of Windows)
  • +
+

+Why most parts of Boost.Locale work only on linear/contiguous chunks of text

+

There are two reasons:

+
    +
  • Boost.Locale relies heavily on the third-party APIs like ICU, POSIX or Win32 API, all of them work only on linear chunks of text, so providing non-linear API would just hide the real situation and would not bring real performance advantage.
  • +
  • In fact, all known libraries that work with Unicode: ICU, Qt, Glib, Win32 API, POSIX API and others accept an input as single linear chunk of text and there is a good reason for this:
    +
      +
    1. Most of supported operations on text like collation, case handling usually work on small chunks of text. For example: you probably would never want to compare two chapters of a book, but rather their titles.
    2. +
    3. We should remember that even very large texts require quite a small amount of memory, for example the entire book "War and Peace" takes only about 3MB of memory.
      +
    4. +
    +
  • +
+

However:

+
    +
  • There are API's that support stream processing. For example: character set conversion using std::codecvt API works on streams of any size without problems.
  • +
  • When new API is introduced into Boost.Locale in future, such that it likely works on large chunks of text, will provide an interface for non-linear text handling.
  • +
+

+Why all Boost.Locale implementation is hidden behind abstract interfaces and does not use template metaprogramming?

+

There are several major reasons:

+
    +
  • This is how the C++'s std::locale class is build. Each feature is represented using a subclass of std::locale::facet that provides an abstract API for specific operations it works on, see Introduction to C++ Standard Library localization support.
  • +
  • This approach allows to switch underlying API without changing the actual application code even in run-time depending on performance and localization requirements.
  • +
  • This approach reduces compilation times significantly. This is very important for library that may be used in almost every part of specific program.
  • +
+

+Why Boost.Locale does not provide char16_t/char32_t for non-C++0x platforms.

+

There are several reasons:

+
    +
  • C++0x defines char16_t and char32_t as distinct types, so substituting is with something like uint16_t or uint32_t would not work as for example writing uint16_t to uint32_t stream would write a number to stream.
  • +
  • The C++ locales system would work only if standard facets like std::num_put are installed into the existing instance of std::locale, however in the many standard C++ libraries these facets are specialized for each specific character that the standard library supports, so an attempt to create a new facet would fail as it is not specialized.
  • +
+

These are exactly the reasons why Boost.Locale fails with current limited C++0x characters support on GCC-4.5 (the second reason) and MSVC-2010 (the first reason)

+

So basically it is impossible to use non-C++ characters with the C++'s locales framework.

+

The best and the most portable solution is to use the C++'s char type and UTF-8 encodings.

+
+ + + diff --git a/doc/html/recommendations_and_myths.html b/doc/html/recommendations_and_myths.html new file mode 100644 index 0000000..631a196 --- /dev/null +++ b/doc/html/recommendations_and_myths.html @@ -0,0 +1,98 @@ + + + + +Boost.Locale: Recommendations and Myths + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Recommendations and Myths

+
+
+

+Recommendations

+
    +
  • The first and most important recommendation: prefer UTF-8 encoding for narrow strings --- it represents all supported Unicode characters and is more convenient for general use than encodings like Latin1.
  • +
  • Remember, there are many different cultures. You can assume very little about the user's language. His calendar may not have "January". It may be not possible to convert strings to integers using atoi because they may not use the "ordinary" digits 0..9 at all. You can't assume that "space" characters are frequent because in Chinese the space character does not separate words. The text may be written from Right-to-Left or from Up-to-Down, and so on.
  • +
  • Using message formatting, try to provide as much context information as you can. Prefer translating entire sentences over single words. When translating words, always add some context information.
  • +
+

+Myths

+

+To use Unicode in my application I should use wide strings everywhere.

+

Unicode is not limited to wide strings. Both std::string and std::wstring can hold and process Unicode text. More than that, the semantics of std::string are much cleaner in multi-platform applications, because all "Unicode" strings are UTF-8. "Wide" strings may be encoded in "UTF-16" or "UTF-32", depending on the platform, so they may be even less convenient when dealing with Unicode than char based strings.

+

+UTF-16 is the best encoding to work with.

+

There is common assumption that UTF-16 is the best encoding for storing information because it gives "shortest" representation of strings.

+

In fact, it is probably the most error-prone encoding to work with. The biggest issue is code points that lay outside of the BMP, which must be represented with surrogate pairs. These characters are very rare and many applications are not tested with them.

+

For example:

+
    +
  • Qt3 could not deal with characters outside of the BMP.
  • +
  • Editing a character with a codepoint above 0xFFFF often shows an unpleasant bug: for example, to erase such a character in Windows Notepad you have to press backspace twice.
  • +
+

So UTF-16 can be used for Unicode, in fact ICU and many other applications use UTF-16 as their internal Unicode representation, but you should be very careful and never assume one-code-point == one-utf16-character.

+
+ + + diff --git a/doc/html/running_examples_under_windows.html b/doc/html/running_examples_under_windows.html new file mode 100644 index 0000000..0736254 --- /dev/null +++ b/doc/html/running_examples_under_windows.html @@ -0,0 +1,87 @@ + + + + +Boost.Locale: Running Examples under Microsoft Windows + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Running Examples under Microsoft Windows

+
+
+

All of the examples that come with Boost.Locale are designed for UTF-8 and it is the default encoding used by Boost.Locale.

+

However, the default narrow encoding under Microsoft Windows is not UTF-8 and the output of the applications would not be displayed correctly in the console.

+

So in order to use UTF-8 encoding under the Windows console and see the output correctly, do the following:

+
    +
  1. Open a cmd window
  2. +
  3. Change the default font to a TrueType font: go to properties->font (right click on title-bar->properties->font) and change the font to a TrueType font like Lucida Console
  4. +
  5. Change the default codepage to 65001 (UTF-8) by running chcp 65001
  6. +
+

Now all of the examples should display UTF-8 characters correctly (if the font supports them).

+

Note for Visual Studio users: Microsoft Visual Studio assumes that all source files are encoded using an "ANSI" codepage like 1252. However all examples use UTF-8 encoding by default, so wide character examples would not work under MSVC as-is. In order to force it to treat source files as UTF-8 you need to convert the files to UTF-8 with BOM, which can be done easily by re-saving them from Notepad, which adds a BOM to UTF-8 files by default.

+
+ + + diff --git a/doc/html/segment_8hpp_source.html b/doc/html/segment_8hpp_source.html new file mode 100644 index 0000000..b18c909 --- /dev/null +++ b/doc/html/segment_8hpp_source.html @@ -0,0 +1,446 @@ + + + + +Boost.Locale: boost/locale/boundary/segment.hpp Source File + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + diff --git a/doc/html/special_thanks.html b/doc/html/special_thanks.html new file mode 100644 index 0000000..881df73 --- /dev/null +++ b/doc/html/special_thanks.html @@ -0,0 +1,82 @@ + + + + +Boost.Locale: Special Thanks + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Special Thanks

+
+
+

(in alphabetical order)

+
    +
  • Chad Nelson - for volunteering to manage the formal review and for the great language corrections for this tutorial.
  • +
  • Vladimir Prus - for development of Boost.Build support for Boost.Locale.
  • +
+
+ + + diff --git a/doc/html/status_of_cpp0x_characters_support.html b/doc/html/status_of_cpp0x_characters_support.html new file mode 100644 index 0000000..ef77931 --- /dev/null +++ b/doc/html/status_of_cpp0x_characters_support.html @@ -0,0 +1,92 @@ + + + + +Boost.Locale: Status of C++0x char16_t/char32_t support + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Status of C++0x char16_t/char32_t support

+
+
+

The support of C++0x char16_t and char32_t is experimental, mostly does not work and not intended to be used in production with current latest compilers: GCC-4.5, MSVC10 till major compiler's flaws would be fixed.

+

+GNU GCC 4.5/C++0x Status

+

GNU C++ compiler provides decent support of C++0x characters however:

+
    +
  1. Standard library does not install any std::locale::facets for this support so any attempt to format numbers using char16_t or char32_t streams would just fail.
  2. +
  3. Standard library misses specialization for required char16_t/char32_t locale facets, so "std" backends is not build-able as essential symbols missing, also codecvt facet can't be created as well.
  4. +
+

+Visual Studio 2010 (MSVC10)/C++0x Status

+

MSVC provides all required facets however:

+
    +
  1. Standard library does not provide installations of std::locale::id for these facets in DLL so it is not usable with /MD, /MDd compiler flags and requires static link of the runtime library.
  2. +
  3. char16_t and char32_t are not distinct types but rather aliases of unsigned short and unsigned types which contradicts to C++0x requirements making it impossible to write char16_t/char32_t to stream and causing multiple faults.
  4. +
+
+ + + diff --git a/doc/html/std_locales.html b/doc/html/std_locales.html new file mode 100644 index 0000000..a52d426 --- /dev/null +++ b/doc/html/std_locales.html @@ -0,0 +1,137 @@ + + + + +Boost.Locale: Introduction to C++ Standard Library localization support + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Introduction to C++ Standard Library localization support

+
+
+

+Getting familiar with standard C++ Locales

+

The C++ standard library offers a simple and powerful way to provide locale-specific information. It is done via the std::locale class, the container that holds all the required information about a specific culture, such as number formatting patterns, date and time formatting, currency, case conversion etc.

+

All this information is provided by facets, special classes derived from the std::locale::facet base class. Such facets are packed into the std::locale class and allow you to provide arbitrary information about the locale. The std::locale class keeps reference counters on installed facets and can be efficiently copied.

+

Each facet that was installed into the std::locale object can be fetched using the std::use_facet function. For example, the std::ctype<Char> facet provides rules for case conversion, so you can convert a character to upper-case like this:

+
std::ctype<char> const &ctype_facet = std::use_facet<std::ctype<char> >(some_locale);
+char upper_a = ctype_facet.toupper('a');
+

A locale object can be imbued into an iostream so it would format information according to the locale:

+
cout.imbue(std::locale("en_US.UTF-8"));
+cout << 1345.45 << endl;
+cout.imbue(std::locale("ru_RU.UTF-8"));
+cout << 1345.45 << endl;
+

Would display:

+
+    1,345.45 1.345,45
+

You can also create your own facets and install them into existing locale objects. For example:

+
    class measure : public std::locale::facet {
+    public:
+        typedef enum { inches, ... } measure_type;
+        measure(measure_type m,size_t refs=0) 
+        double from_metric(double value) const;
+        std::string name() const;
+        ...
+    };
+

And now you can simply provide this information to a locale:

+
    std::locale::global(std::locale(std::locale("en_US.UTF-8"),new measure(measure::inches)));
+    /// Create default locale built from en_US locale and add paper size facet.
+

Now you can print a distance according to the correct locale:

+
    void print_distance(std::ostream &out,double value)
+    {
+        measure const &m = std::use_facet<measure>(out.getloc());
+        // Fetch locale information from stream
+        out << m.from_metric(value) << " " << m.name();
+    }
+

This technique was adopted by the Boost.Locale library in order to provide powerful and correct localization. Instead of using the very limited C++ standard library facets, it uses ICU under the hood to create its own much more powerful ones.

+

+Common Critical Problems with the Standard Library

+

There are numerous issues in the standard library that prevent the use of its full power, and there are several additional issues:

+
    +
  • Setting the global locale has bad side effects.
    + Consider following code:
    +
            int main()
    +        {
    +            std::locale::global(std::locale("")); 
    +            // Set system's default locale as global
    +            std::ofstream csv("test.csv");
    +            csv << 1.1 << ","  << 1.3 << std::endl;
    +        }
    +

    + What would be the content of test.csv ? It may be "1.1,1.3" or it may be "1,1,1,3" rather than what you had expected.
    + More than that it affects even printf and libraries like boost::lexical_cast giving incorrect or unexpected formatting. In fact many third-party libraries are broken in such a situation.
    + Unlike the standard localization library, Boost.Locale never changes the basic number formatting, even when it uses std based localization backends, so by default, numbers are always formatted using C-style locale. Localized number formatting requires specific flags.
    +
  • +
  • Number formatting is broken on some locales.
    + Some locales use the non-breakable space u00A0 character for thousands separator, thus in ru_RU.UTF-8 locale number 1024 should be displayed as "1 024" where the space is a Unicode character with codepoint u00A0. Unfortunately many libraries don't handle this correctly, for example GCC and SunStudio display a "\xC2" character instead of the first character in the UTF-8 sequence "\xC2\xA0" that represents this code point, and actually generate invalid UTF-8.
    +
  • +
  • Locale names are not standardized. For example, under MSVC you need to provide the name en-US or English_USA.1252 , when on POSIX platforms it would be en_US.UTF-8 or en_US.ISO-8859-1
    + More than that, MSVC does not support UTF-8 locales at all.
    +
  • +
  • Many standard libraries provide only the C and POSIX locales, thus GCC supports localization only under Linux. On all other platforms, attempting to create locales other than "C" or "POSIX" would fail.
  • +
+
+ + + diff --git a/doc/html/structboost_1_1locale_1_1boundary_1_1break__info-members.html b/doc/html/structboost_1_1locale_1_1boundary_1_1break__info-members.html new file mode 100644 index 0000000..d706d2b --- /dev/null +++ b/doc/html/structboost_1_1locale_1_1boundary_1_1break__info-members.html @@ -0,0 +1,84 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::boundary::break_info Member List

+
+ + + + diff --git a/doc/html/structboost_1_1locale_1_1boundary_1_1break__info.html b/doc/html/structboost_1_1locale_1_1boundary_1_1break__info.html new file mode 100644 index 0000000..0d5a6dd --- /dev/null +++ b/doc/html/structboost_1_1locale_1_1boundary_1_1break__info.html @@ -0,0 +1,202 @@ + + + + +Boost.Locale: boost::locale::boundary::break_info Struct Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::boundary::break_info Struct Reference
+ +[Boundary Analysis] +

+
+
+ +

This structure is used for representing boundary point that follows the offset. +More...

+ +

#include <boost/locale/boundary/facets.hpp>

+ +

List of all members.

+ + + + + + + + +

+Public Member Functions

 break_info ()
 break_info (size_t v)
bool operator< (break_info const &other) const

+Public Attributes

size_t offset
rule_type rule
+

Detailed Description

+

This structure is used for representing boundary point that follows the offset.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + +
boost::locale::boundary::break_info::break_info ( )  [inline]
+
+
+

Create empty break point at beginning

+ +
+
+ +
+
+ + + + + + + + + +
boost::locale::boundary::break_info::break_info (size_t  v )  [inline]
+
+
+

Create empty break point at offset v. it is useful for order comparison with other points.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + + +
bool boost::locale::boundary::break_info::operator< (break_info const &  other )  const [inline]
+
+
+

Compare two break points' offset. Allows to search with standard algorithms over the index.

+ +
+
+

Member Data Documentation

+ +
+ +
+

Offset from the beggining of the text where a break occurs.

+ +
+
+ +
+ +
+

The identification of this break point according to various break types

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + diff --git a/doc/html/structboost_1_1locale_1_1comparator-members.html b/doc/html/structboost_1_1locale_1_1comparator-members.html new file mode 100644 index 0000000..514946f --- /dev/null +++ b/doc/html/structboost_1_1locale_1_1comparator-members.html @@ -0,0 +1,81 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::comparator< CharType, default_level > Member List

+
+
+This is the complete list of members for boost::locale::comparator< CharType, default_level >, including all inherited members. + + +
comparator(std::locale const &l=std::locale(), collator_base::level_type level=default_level)boost::locale::comparator< CharType, default_level > [inline]
operator()(std::basic_string< CharType > const &left, std::basic_string< CharType > const &right) const boost::locale::comparator< CharType, default_level > [inline]
+ + + diff --git a/doc/html/structboost_1_1locale_1_1comparator.html b/doc/html/structboost_1_1locale_1_1comparator.html new file mode 100644 index 0000000..d9d7e19 --- /dev/null +++ b/doc/html/structboost_1_1locale_1_1comparator.html @@ -0,0 +1,177 @@ + + + + +Boost.Locale: boost::locale::comparator< CharType, default_level > Struct Template Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::comparator< CharType, default_level > Struct Template Reference
+ +[Collation] +

+
+
+ +

This class can be used in STL algorithms and containers for comparison of strings with a level other than primary. +More...

+ +

#include <boost/locale/collator.hpp>

+ +

List of all members.

+ + + + +

+Public Member Functions

 comparator (std::locale const &l=std::locale(), collator_base::level_type level=default_level)
bool operator() (std::basic_string< CharType > const &left, std::basic_string< CharType > const &right) const
+

Detailed Description

+

template<typename CharType, collator_base::level_type default_level = collator_base::identical>
+ struct boost::locale::comparator< CharType, default_level >

+ +

This class can be used in STL algorithms and containers for comparison of strings with a level other than primary.

+

For example:

+
  std::map<std::string,std::string,comparator<char,collator_base::secondary> > data;
+

Would create a map the keys of which are sorted using secondary collation level

+

Constructor & Destructor Documentation

+ +
+
+
+template<typename CharType , collator_base::level_type default_level = collator_base::identical>
+ + + + + + + + + + + + + + + + + + +
boost::locale::comparator< CharType, default_level >::comparator (std::locale const &  l = std::locale(),
collator_base::level_type  level = default_level 
) [inline]
+
+
+

Create a comparator class for locale l and with collation leval level

+
Note:
throws std::bad_cast if l does not have collator facet installed
+ +
+
+

Member Function Documentation

+ +
+
+
+template<typename CharType , collator_base::level_type default_level = collator_base::identical>
+ + + + + + + + + + + + + + + + + + +
bool boost::locale::comparator< CharType, default_level >::operator() (std::basic_string< CharType > const &  left,
std::basic_string< CharType > const &  right 
) const [inline]
+
+
+

Compare two strings -- equivalent to return left < right according to collation rules

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + diff --git a/doc/html/structboost_1_1locale_1_1date__time__period-members.html b/doc/html/structboost_1_1locale_1_1date__time__period-members.html new file mode 100644 index 0000000..928d458 --- /dev/null +++ b/doc/html/structboost_1_1locale_1_1date__time__period-members.html @@ -0,0 +1,84 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::date_time_period Member List

+
+
+This is the complete list of members for boost::locale::date_time_period, including all inherited members. + + + + + +
date_time_period(period::period_type f=period::period_type(), int v=1)boost::locale::date_time_period [inline]
operator+() const boost::locale::date_time_period [inline]
operator-() const boost::locale::date_time_period [inline]
typeboost::locale::date_time_period
valueboost::locale::date_time_period
+ + + diff --git a/doc/html/structboost_1_1locale_1_1date__time__period.html b/doc/html/structboost_1_1locale_1_1date__time__period.html new file mode 100644 index 0000000..987a3d5 --- /dev/null +++ b/doc/html/structboost_1_1locale_1_1date__time__period.html @@ -0,0 +1,198 @@ + + + + +Boost.Locale: boost::locale::date_time_period Struct Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::date_time_period Struct Reference
+ +[Date, Time, Timezone and Calendar manipulations] +

+
+
+ +

This class represents a pair of period_type and the integer values that describes its amount. For example 3 days or 4 years. +More...

+ +

#include <boost/locale/date_time.hpp>

+ +

List of all members.

+ + + + + + + + + +

+Public Member Functions

date_time_period operator+ () const
date_time_period operator- () const
 date_time_period (period::period_type f=period::period_type(), int v=1)

+Public Attributes

+period::period_type type
 The type of period, i.e. era, year, day etc.
int value
+

Detailed Description

+

This class represents a pair of period_type and the integer values that describes its amount. For example 3 days or 4 years.

+

Usually obtained as product of period_type and integer or my calling a representative functions For example day()*3 == date_time_period(day(),3) == day(3)

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
boost::locale::date_time_period::date_time_period (period::period_type  f = period::period_type(),
int  v = 1 
) [inline]
+
+
+

Constructor that creates date_time_period from period_type f and a value v -- default 1.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + +
date_time_period boost::locale::date_time_period::operator+ ( )  const [inline]
+
+
+

Operator + returns copy of itself

+ +
+
+ +
+
+ + + + + + + + +
date_time_period boost::locale::date_time_period::operator- ( )  const [inline]
+
+
+

Operator -, switches the sign of period

+ +
+
+

Member Data Documentation

+ +
+ +
+

The value the actual number of periods

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + diff --git a/doc/html/structboost_1_1locale_1_1gnu__gettext_1_1messages__info-members.html b/doc/html/structboost_1_1locale_1_1gnu__gettext_1_1messages__info-members.html new file mode 100644 index 0000000..1822cc8 --- /dev/null +++ b/doc/html/structboost_1_1locale_1_1gnu__gettext_1_1messages__info-members.html @@ -0,0 +1,90 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::gnu_gettext::messages_info Member List

+
+ + + + diff --git a/doc/html/structboost_1_1locale_1_1gnu__gettext_1_1messages__info.html b/doc/html/structboost_1_1locale_1_1gnu__gettext_1_1messages__info.html new file mode 100644 index 0000000..b0757f3 --- /dev/null +++ b/doc/html/structboost_1_1locale_1_1gnu__gettext_1_1messages__info.html @@ -0,0 +1,237 @@ + + + + +Boost.Locale: boost::locale::gnu_gettext::messages_info Struct Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::gnu_gettext::messages_info Struct Reference

+
+
+ +

This structure holds all information required for creating gnu-gettext message catalogs,. +More...

+ +

#include <boost/locale/gnu_gettext.hpp>

+ +

List of all members.

+ + + + + + + + + + + + + + + + + + + +

+Classes

struct  domain
 This type represents GNU Gettext domain name for the messages. More...

+Public Types

typedef std::vector< domaindomains_type
typedef function< std::vector
+< char > std::string const
+&file_name, std::string const
+&encoding) > 
callback_type

+Public Attributes

+std::string language
 The language we load the catalog for, like "ru", "en", "de".
+std::string country
 The country we load the catalog for, like "US", "IL".
+std::string variant
 Language variant, like "euro" so it would look for catalog like de_DE@euro.
std::string encoding
std::string locale_category
domains_type domains
std::vector< std::string > paths
callback_type callback
+

Detailed Description

+

This structure holds all information required for creating gnu-gettext message catalogs,.

+

The user is expected to set its parameters to load these catalogs correctly. This structure also allows providing functions for charset conversion. Note, you need to provide them, so this structure is not useful for wide characters without subclassing and it will also ignore gettext catalogs that use a charset different from encoding.

+

Member Typedef Documentation

+ +
+
+ + + + +
typedef function< std::vector<char> std::string const &file_name, std::string const &encoding ) > boost::locale::gnu_gettext::messages_info::callback_type
+
+
+

The callback for custom file system support. This callback should read the file named file_name encoded in encoding character set into std::vector<char> and return it.

+
    +
  • If the file does not exist, it should return an empty vector.
  • +
  • If a error occurs during file read it should throw a error.
  • +
+
Note:
The user should support only the encodings the locales are created for. So if the user uses only one encoding or the file system is encoding agnostic, he may ignore the encoding parameter.
+ +
+
+ +
+ +
+

Type that defines a list of domains that are loaded The first one is the default one

+ +
+
+

Member Data Documentation

+ +
+ +
+

The callback for handling custom file systems, if it is empty, the real OS file-system is being used.

+ +
+
+ +
+ +
+

Message domains - application name, like my_app. So files named my_app.mo would be loaded

+ +
+
+ +
+ +
+

Required target charset encoding. Ignored for wide characters. For narrow, should specify the correct encoding required for this catalog

+ +
+
+ +
+ +
+

Locale category, is set by default to LC_MESSAGES, but may be changed

+ +
+
+ +
+
+ + + + +
std::vector<std::string> boost::locale::gnu_gettext::messages_info::paths
+
+
+

Paths to search files in. Under MS Windows it uses encoding parameter to convert them to wide OS specific paths.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + diff --git a/doc/html/structboost_1_1locale_1_1gnu__gettext_1_1messages__info_1_1domain-members.html b/doc/html/structboost_1_1locale_1_1gnu__gettext_1_1messages__info_1_1domain-members.html new file mode 100644 index 0000000..3db9d83 --- /dev/null +++ b/doc/html/structboost_1_1locale_1_1gnu__gettext_1_1messages__info_1_1domain-members.html @@ -0,0 +1,85 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::gnu_gettext::messages_info::domain Member List

+
+ + + + diff --git a/doc/html/structboost_1_1locale_1_1gnu__gettext_1_1messages__info_1_1domain.html b/doc/html/structboost_1_1locale_1_1gnu__gettext_1_1messages__info_1_1domain.html new file mode 100644 index 0000000..efb40be --- /dev/null +++ b/doc/html/structboost_1_1locale_1_1gnu__gettext_1_1messages__info_1_1domain.html @@ -0,0 +1,181 @@ + + + + +Boost.Locale: boost::locale::gnu_gettext::messages_info::domain Struct Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::gnu_gettext::messages_info::domain Struct Reference

+
+
+ +

This type represents GNU Gettext domain name for the messages. +More...

+ +

#include <boost/locale/gnu_gettext.hpp>

+ +

List of all members.

+ + + + + + + + + + +

+Public Member Functions

 domain (std::string const &n)
bool operator== (domain const &other) const
bool operator!= (domain const &other) const

+Public Attributes

+std::string name
 The name of the domain.
+std::string encoding
 The character encoding for the domain.
+

Detailed Description

+

This type represents GNU Gettext domain name for the messages.

+

It consists of two parameters:

+
    +
  • name - the name of the domain - used for opening the file name
  • +
  • encoding - the encoding of the keys in the sources, default - UTF-8
  • +
+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + +
boost::locale::gnu_gettext::messages_info::domain::domain (std::string const &  n )  [inline]
+
+
+

Create a domain object from the name that can hold an encoding after symbol "/" such that if n is "hello/cp1255" then the name would be "hello" and "encoding" would be "cp1255" and if n is "hello" then the name would be the same but encoding would be "UTF-8"

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + + +
bool boost::locale::gnu_gettext::messages_info::domain::operator!= (domain const &  other )  const [inline]
+
+
+

Check whether two objects are distinct, only names are compared, encoding is ignored

+ +
+
+ +
+
+ + + + + + + + + +
bool boost::locale::gnu_gettext::messages_info::domain::operator== (domain const &  other )  const [inline]
+
+
+

Check whether two objects are equivalent, only names are compared, encoding is ignored

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + diff --git a/doc/html/structboost_1_1locale_1_1posix__time-members.html b/doc/html/structboost_1_1locale_1_1posix__time-members.html new file mode 100644 index 0000000..2126cf0 --- /dev/null +++ b/doc/html/structboost_1_1locale_1_1posix__time-members.html @@ -0,0 +1,81 @@ + + + + +Boost.Locale: Member List + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

boost::locale::posix_time Member List

+
+
+This is the complete list of members for boost::locale::posix_time, including all inherited members. + + +
nanosecondsboost::locale::posix_time
secondsboost::locale::posix_time
+ + + diff --git a/doc/html/structboost_1_1locale_1_1posix__time.html b/doc/html/structboost_1_1locale_1_1posix__time.html new file mode 100644 index 0000000..603dfb4 --- /dev/null +++ b/doc/html/structboost_1_1locale_1_1posix__time.html @@ -0,0 +1,106 @@ + + + + +Boost.Locale: boost::locale::posix_time Struct Reference + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+ +
+

boost::locale::posix_time Struct Reference

+
+
+ +

#include <boost/locale/date_time_facet.hpp>

+ +

List of all members.

+ + + + + + +

+Public Attributes

+int64_t seconds
 Seconds since epoch.
+uint32_t nanoseconds
 Nanoseconds resolution.
+

Detailed Description

+

Structure that define POSIX time, seconds and milliseconds since Jan 1, 1970, 00:00 not including leap seconds.

+
The documentation for this struct was generated from the following file: +
+ + + diff --git a/doc/html/tab_a.png b/doc/html/tab_a.png new file mode 100644 index 0000000..2d99ef2 Binary files /dev/null and b/doc/html/tab_a.png differ diff --git a/doc/html/tab_b.png b/doc/html/tab_b.png new file mode 100644 index 0000000..b2c3d2b Binary files /dev/null and b/doc/html/tab_b.png differ diff --git a/doc/html/tab_h.png b/doc/html/tab_h.png new file mode 100644 index 0000000..c11f48f Binary files /dev/null and b/doc/html/tab_h.png differ diff --git a/doc/html/tab_s.png b/doc/html/tab_s.png new file mode 100644 index 0000000..978943a Binary files /dev/null and b/doc/html/tab_s.png differ diff --git a/doc/html/tabs.css b/doc/html/tabs.css new file mode 100644 index 0000000..2192056 --- /dev/null +++ b/doc/html/tabs.css @@ -0,0 +1,59 @@ +.tabs, .tabs2, .tabs3 { + background-image: url('tab_b.png'); + width: 100%; + z-index: 101; + font-size: 13px; +} + +.tabs2 { + font-size: 10px; +} +.tabs3 { + font-size: 9px; +} + +.tablist { + margin: 0; + padding: 0; + display: table; +} + +.tablist li { + float: left; + display: table-cell; + background-image: url('tab_b.png'); + line-height: 36px; + list-style: none; +} + +.tablist a { + display: block; + padding: 0 20px; + font-weight: bold; + background-image:url('tab_s.png'); + background-repeat:no-repeat; + background-position:right; + color: #283A5D; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; + outline: none; +} + +.tabs3 .tablist a { + padding: 0 10px; +} + +.tablist a:hover { + background-image: url('tab_h.png'); + background-repeat:repeat-x; + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); + text-decoration: none; +} + +.tablist li.current a { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} diff --git a/doc/html/tested_compilers_and_paltforms.html b/doc/html/tested_compilers_and_paltforms.html new file mode 100644 index 0000000..e8076f1 --- /dev/null +++ b/doc/html/tested_compilers_and_paltforms.html @@ -0,0 +1,119 @@ + + + + +Boost.Locale: Tested Compilers and Platforms + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Tested Compilers and Platforms

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PlatformCompilerBackendsICU versionNotes
Linux 2.6 x86_64GCC-4.3icu/posix/std3.8, 4.4, 4.6-
Linux 2.6 x86GCC-4.1icu/posix/std3.6(not tested recently)
Linux 2.6 x86_64GCC-4.4icu/posix/std4.2-
Linux 2.6 x86_64GCC-4.5/C++0xicu/posix/std3.8-
Linux 2.6 x86_64GCC-4.6icu/posix/std4.2, 4.6-
Linux 2.6 x86_64GCC-4.6/C++0xicu/posix/std4.2, 4.6-
Linux 2.6 x86_64GCC-4.5/C++0x with char16_t/char32_ticu3.8 Some charXX_t faults in formatting
+ std backend can't be build
+ Standard library issues
Linux 2.6 x86_64Intel 11.0icu/posix/std3.8-
Windows 7 32bitMSVC 2010icu/winapi/std4.6-
Windows 7 32bitMSVC 2010/C++0x with char16_t/char32_ticu/winapi/std4.6 Multiple test faults, because char16_t/char32_t are not defined as distinct types as required by C++ standard.
Windows XP 32bitMSVC 2008icu/winapi/std4.2-
Windows XP 32bitMinGW/GCC 4.5icu/winapi/std4.2-
Cygwin 1.7GCC 4.3icu/winapi/std3.8-
Mac OS X 10.6.4GCC-4.2icu/posix/std4.4-
FreeBSD 8.0GCC-4.2.1icu/std3.8-
OpenSolaris/SunOS 5.11GCC-3.4icu/std4.2iconv is disabled
OpenSolaris/SunOS 5.11SunCC 5.10/STLport4icu4.2 Some faults in collation, STLport issue
+ iconv is disabled
+ Boost-1.46.x requires patch for Boost.Thread, can be found in libs/locale/build
+
+ + + diff --git a/doc/html/time__zone_8hpp_source.html b/doc/html/time__zone_8hpp_source.html new file mode 100644 index 0000000..875add2 --- /dev/null +++ b/doc/html/time__zone_8hpp_source.html @@ -0,0 +1,115 @@ + + + + +Boost.Locale: boost/locale/time_zone.hpp Source File + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + diff --git a/doc/html/tree.html b/doc/html/tree.html new file mode 100644 index 0000000..880def1 --- /dev/null +++ b/doc/html/tree.html @@ -0,0 +1,245 @@ + + + + + + + + TreeView + + + + +
+

Boost.Locale

+
+

o+Boost.Locale

+ +

o+Modules

+ +

o+Class List

+ +

o+Class Hierarchy

+ +

o*Class Members

+

o+Namespace List

+ +

o*Namespace Members

+

o+File List

+
+

|o*boost/locale/boundary.hpp

+

|o*boost/locale/collator.hpp

+

|o*boost/locale/config.hpp

+

|o*boost/locale/conversion.hpp

+

|o*boost/locale/date_time.hpp

+

|o*boost/locale/date_time_facet.hpp

+

|o*boost/locale/encoding.hpp

+

|o*boost/locale/format.hpp

+

|o*boost/locale/formatting.hpp

+

|o*boost/locale/generator.hpp

+

|o*boost/locale/gnu_gettext.hpp

+

|o*boost/locale/hold_ptr.hpp

+

|o*boost/locale/info.hpp

+

|o*boost/locale/localization_backend.hpp

+

|o*boost/locale/message.hpp

+

|o*boost/locale/time_zone.hpp

+

|o*boost/locale/util.hpp

+

|o*boost/locale/boundary/boundary_point.hpp

+

|o*boost/locale/boundary/facets.hpp

+

|o*boost/locale/boundary/index.hpp

+

|o*boost/locale/boundary/segment.hpp

+

|\*boost/locale/boundary/types.hpp

+
+

\+Examples

+ +
+
+ + diff --git a/doc/html/types_8hpp_source.html b/doc/html/types_8hpp_source.html new file mode 100644 index 0000000..f458e34 --- /dev/null +++ b/doc/html/types_8hpp_source.html @@ -0,0 +1,166 @@ + + + + +Boost.Locale: boost/locale/boundary/types.hpp Source File + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + diff --git a/doc/html/using_boost_locale.html b/doc/html/using_boost_locale.html new file mode 100644 index 0000000..fe86171 --- /dev/null +++ b/doc/html/using_boost_locale.html @@ -0,0 +1,90 @@ + + + + +Boost.Locale: Using Boost.Locale + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Using Boost.Locale

+
+
+

In this section we'll talk mostly about the ICU backend, as it is both the default and the most powerful localization backend provided by this library. In later sections we will note the features that are supported by other localization backends.

+ +
+ + + diff --git a/doc/html/using_localization_backends.html b/doc/html/using_localization_backends.html new file mode 100644 index 0000000..1dbc61b --- /dev/null +++ b/doc/html/using_localization_backends.html @@ -0,0 +1,179 @@ + + + + +Boost.Locale: Using Localization Backends + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Using Localization Backends

+
+
+

By default, Boost.Locale uses ICU for all localization and text manipulation tasks. This is the most powerful library available, but sometimes we don't need the full power of this library or we want to reduce dependencies from third-party libraries, and ICU is by no means a small library.

+

Boost.Locale provides an option to use non-ICU based localization backends. Although usually less powerful, these often provide all you need: message formatting, currency, date, time, number formatting, basic collation and case manipulation. They are implemented using the standard OS API or a C or C++ library.

+

+When to use non-ICU backends

+

There are situations when using non-ICU based localization is appropriate:

+
    +
  • Embedded systems, where the ICU library is very hefty.
  • +
  • Applications where only basic features like message, date, and time formatting and basic collation are required, and using a third-party library like ICU would be too complicated.
  • +
  • Performance. ICU is a very powerful library, but it is generally slower than the standard library. Sometimes it's better to use a simpler but faster localization backend.
  • +
+

+Non-ICU Backends

+

All of the alternate backends have these limitations:

+
    +
  • Only the Gregorian calendar is supported and it is based on capabilites of mktime functionality (including dates range)
  • +
  • No boundary analysis.
  • +
  • Case handling is very simple and based on single codepoint conversions, though they still handle UTF-8 better than the standard library.
  • +
  • Time zone specification is very limited: either local time or a time zone in the format "GMT+HH:MM".
  • +
  • No percent formatting, no spellout or ordinal number formatting.
  • +
  • Collation, with exception of the winapi backend, is limited to a single level, similar to what is done by strcoll.
  • +
+

+std - The standard C++ library backend

+

This localization backend is based on the standard C++ library.

+

It is supported on all platforms, but is only actually useful on platforms where the standard library supports locales besides "C" and "POSIX": on Linux with GCC or Intel compilers, and under the MSVC compiler.

+

It works around some common standard library bugs like invalid UTF-8 generation for numeric formatting, and it gives otherwise-absent POSIX locales names and UTF-8 support under MSVC.

+

It is very useful when the compiler and the library actually give fine localization support, like GCC under Linux or MSVC under Windows.

+

+posix - POSIX 2008 C library

+

This backend is based on the latest POSIX 2008 standards, and uses POSIX api functions like newlocale, freelocale, strftime_l etc. It is available on the Linux and Mac OS X platforms.

+

It gives you simple and ready-made localization support, most notably under Mac OS X where GCC's libstdc++ does not support locales.

+
Note:
The POSIX backend only supports UTF-8, single-byte, and double-byte encodings.
+

+winapi - Win32 API.

+

The Win32API-based localization backend provides decent UTF-8/UTF-16 locale support. It is based on Windows API functions like GetLocaleInfoW, LCMapStringW, GetDateFormatW etc and provides good localization support even on the MinGW and Cygwin platforms, which normally have problems with this.

+
Note:
+
    +
  • If you using GCC compiler under Windows you need GCC-4.x series to use it, GCC-3.4 is not supported
  • +
  • Only UTF-8 as narrow locale encoding and UTF-16 as wide encoding are supported.
  • +
+

+Supported Features

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Backend icuposixwinapistd
Message Formatting YesYesYesYes
Non UTF-8 encodings YesYesNoYes
Date/Time Formatting/Parsing YesFormatting OnlyFormatting OnlyFormatting Only
Monetary Formatting/Parsing YesFormatting OnlyFormatting OnlyYes
Number Formatting/Parsing YesYesYesYes
Numbers as Percent, Spelled Out YesNoNoNo
Case Manipulation YesBasicBasicBasic
Collation FullLinux - 1 level
+Mac OS X - broken
3 levels1 level
Calendar YesGregorian OnlyGregorian OnlyGregorian Only
Boundary Analysis YesNoNoNo
Unicode Normalization YesNoVista and aboveNo
C++0x characters YesNoNoYes
OS Support AnyLinux, Mac OS XWindows, CygwinAny
Useful on Any PlatformLinux and Mac OS XWindows/MinGW/CygwinLinux with GCC or Intel
+Windows with MSVC
+

+Using Localization Backends

+

Accessing a localization backend is done via the boost::locale::localization_backend_manager class.

+

You can create your own boost::locale::localization_backend_manager by starting with a global backend via the boost::locale::localization_backend_manager::global static member function and modifying it.

+

For example:

+
    localization_backend_manager my = localization_backend_manager::global(); 
+    // Get global backend
+
+    my.select("std"); 
+    // select std backend as default
+
+    generator gen(my); 
+    // create a generator that uses this backend.
+
+    localization_backend_manager::global(my);
+    // set this backend globally
+
+    generator gen2();
+    // now this one would use the new global backend.
+

You can also create a mixture of several backends, using for example icu for one kind of operation and std for all others:

+
    localization_backend_manager my = localization_backend_manager::global(); 
+    // Get global backend
+
+    my.select("std"); 
+    // select std backend as default for all categories
+    my.select("icu",boundary_facet); 
+    // select icu backend for boundary analysis (since it is not supported by \c std)
+
+ + + diff --git a/doc/html/util_8hpp_source.html b/doc/html/util_8hpp_source.html new file mode 100644 index 0000000..3298e18 --- /dev/null +++ b/doc/html/util_8hpp_source.html @@ -0,0 +1,163 @@ + + + + +Boost.Locale: boost/locale/util.hpp Source File + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + + + + diff --git a/doc/html/wboundary_8cpp-example.html b/doc/html/wboundary_8cpp-example.html new file mode 100644 index 0000000..1a9abf8 --- /dev/null +++ b/doc/html/wboundary_8cpp-example.html @@ -0,0 +1,174 @@ + + + + +Boost.Locale: wboundary.cpp + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

wboundary.cpp

+
+
+

Example of using segment_index over wide strings

+
//
+//  Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
+//
+//  Distributed under the Boost Software License, Version 1.0. (See
+//  accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+//
+
+//
+// ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
+//
+// BIG FAT WARNING FOR Microsoft Visual Studio Users
+//
+// YOU NEED TO CONVERT THIS SOURCE FILE ENCODING TO UTF-8 WITH BOM ENCODING.
+//
+// Unfortunately MSVC understands that the source code is encoded as
+// UTF-8 only if you add useless BOM in the beginning.
+//
+// So, before you compile "wide" examples with MSVC, please convert them to text
+// files with BOM. There are two very simple ways to do it:
+//
+// 1. Open file with Notepad and save it from there. It would convert 
+//    it to file with BOM.
+// 2. In Visual Studio go File->Advances Save Options... and select
+//    Unicode (UTF-8  with signature) Codepage 65001
+//
+// Note: once converted to UTF-8 with BOM, this source code would not
+// compile with other compilers, because no-one uses BOM with UTF-8 today
+// because it is absolutely meaningless in context of UTF-8.
+//
+// ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
+//
+#include <boost/locale.hpp>
+#include <iostream>
+#include <cassert>
+#include <ctime>
+
+int main()
+{
+    using namespace boost::locale;
+    using namespace std;
+
+    // Create system default locale
+    generator gen;
+    locale loc=gen("");
+    locale::global(loc); 
+    wcout.imbue(loc);
+    
+    // This is needed to prevent C library to
+    // convert strings to narrow 
+    // instead of C++ on some platforms
+    std::ios_base::sync_with_stdio(false);
+
+
+    wstring text=L"Hello World! あにま! Linux2.6 and Windows7 is word and number. שָלוֹם עוֹלָם!";
+
+    wcout<<text<<endl;
+
+    boundary::wssegment_index index(boundary::word,text.begin(),text.end());
+    boundary::wssegment_index::iterator p,e;
+
+    for(p=index.begin(),e=index.end();p!=e;++p) {
+        wcout<<L"Part ["<<*p<<L"] has ";
+        if(p->rule() & boundary::word_number)
+            wcout<<L"number(s) ";
+        if(p->rule() & boundary::word_letter)
+            wcout<<L"letter(s) ";
+        if(p->rule() & boundary::word_kana)
+            wcout<<L"kana character(s) ";
+        if(p->rule() & boundary::word_ideo)
+            wcout<<L"ideographic character(s) ";
+        if(p->rule() & boundary::word_none)
+            wcout<<L"no word characters";
+        wcout<<endl;
+    }
+
+    index.map(boundary::character,text.begin(),text.end());
+
+    for(p=index.begin(),e=index.end();p!=e;++p) {
+        wcout<<L"|" <<*p ;
+    }
+    wcout<<L"|\n\n";
+
+    index.map(boundary::line,text.begin(),text.end());
+
+    for(p=index.begin(),e=index.end();p!=e;++p) {
+        wcout<<L"|" <<*p ;
+    }
+    wcout<<L"|\n\n";
+
+    index.map(boundary::sentence,text.begin(),text.end());
+
+    for(p=index.begin(),e=index.end();p!=e;++p) {
+        wcout<<L"|" <<*p ;
+    }
+    wcout<<"|\n\n";
+    
+}
+
+
+// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
+
+
+ + + diff --git a/doc/html/wconversions_8cpp-example.html b/doc/html/wconversions_8cpp-example.html new file mode 100644 index 0000000..20c254c --- /dev/null +++ b/doc/html/wconversions_8cpp-example.html @@ -0,0 +1,144 @@ + + + + +Boost.Locale: wconversions.cpp + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

wconversions.cpp

+
+
+

Example of using various text conversion functions with wide strings.

+
//
+//  Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
+//
+//  Distributed under the Boost Software License, Version 1.0. (See
+//  accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+//
+
+//
+// ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
+//
+// BIG FAT WARNING FOR Microsoft Visual Studio Users
+//
+// YOU NEED TO CONVERT THIS SOURCE FILE ENCODING TO UTF-8 WITH BOM ENCODING.
+//
+// Unfortunately MSVC understands that the source code is encoded as
+// UTF-8 only if you add useless BOM in the beginning.
+//
+// So, before you compile "wide" examples with MSVC, please convert them to text
+// files with BOM. There are two very simple ways to do it:
+//
+// 1. Open file with Notepad and save it from there. It would convert 
+//    it to file with BOM.
+// 2. In Visual Studio go File->Advances Save Options... and select
+//    Unicode (UTF-8  with signature) Codepage 65001
+//
+// Note: once converted to UTF-8 with BOM, this source code would not
+// compile with other compilers, because no-one uses BOM with UTF-8 today
+// because it is absolutely meaningless in context of UTF-8.
+//
+// ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
+//
+#include <boost/locale.hpp>
+#include <boost/algorithm/string/case_conv.hpp>
+#include <iostream>
+
+#include <ctime>
+
+
+int main()
+{
+    using namespace boost::locale;
+    using namespace std;
+    // Create system default locale
+    generator gen;
+    locale loc=gen(""); 
+    locale::global(loc);
+    wcout.imbue(loc);
+
+    // This is needed to prevent C library to
+    // convert strings to narrow 
+    // instead of C++ on some platforms
+    std::ios_base::sync_with_stdio(false);
+
+    
+    wcout<<L"Correct case conversion can't be done by simple, character by character conversion"<<endl;
+    wcout<<L"because case conversion is context sensitive and not 1-to-1 conversion"<<endl;
+    wcout<<L"For example:"<<endl;
+    wcout<<L"   German grüßen correctly converted to "<<to_upper(L"grüßen")<<L", instead of incorrect "
+                    <<boost::to_upper_copy(std::wstring(L"grüßen"))<<endl;
+    wcout<<L"     where ß is replaced with SS"<<endl;
+    wcout<<L"   Greek ὈΔΥΣΣΕΎΣ is correctly converted to "<<to_lower(L"ὈΔΥΣΣΕΎΣ")<<L", instead of incorrect "
+                    <<boost::to_lower_copy(std::wstring(L"ὈΔΥΣΣΕΎΣ"))<<endl;
+    wcout<<L"     where Σ is converted to σ or to ς, according to position in the word"<<endl;
+    wcout<<L"Such type of conversion just can be done using std::toupper that work on character base, also std::toupper is "<<endl;
+    wcout<<L"not fully applicable when working with variable character length like in UTF-8 or UTF-16 limiting the correct "<<endl;
+    wcout<<L"behavoir to BMP or ASCII only"<<endl;
+   
+}
+
+// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
+
+ + + + diff --git a/doc/html/whello_8cpp-example.html b/doc/html/whello_8cpp-example.html new file mode 100644 index 0000000..d1c1cc7 --- /dev/null +++ b/doc/html/whello_8cpp-example.html @@ -0,0 +1,118 @@ + + + + +Boost.Locale: whello.cpp + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

whello.cpp

+
+
+

Basic example of using various functions with wide strings provided by this library

+
//
+//  Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
+//
+//  Distributed under the Boost Software License, Version 1.0. (See
+//  accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+//
+#include <boost/locale.hpp>
+#include <iostream>
+
+#include <ctime>
+
+int main()
+{
+    using namespace boost::locale;
+    using namespace std;
+    
+    // Create system default locale
+    generator gen;
+    locale loc=gen(""); 
+    locale::global(loc);
+    wcout.imbue(loc);
+    
+    // This is needed to prevent C library to
+    // convert strings to narrow 
+    // instead of C++ on some platforms
+    std::ios_base::sync_with_stdio(false);
+
+    
+    wcout <<wformat(L"Today {1,date} at {1,time} we had run our first localization example") % time(0) 
+          <<endl;
+   
+    wcout<<L"This is how we show numbers in this locale "<<as::number << 103.34 <<endl; 
+    wcout<<L"This is how we show currency in this locale "<<as::currency << 103.34 <<endl; 
+    wcout<<L"This is typical date in the locale "<<as::date << std::time(0) <<endl;
+    wcout<<L"This is typical time in the locale "<<as::time << std::time(0) <<endl;
+    wcout<<L"This is upper case "<<to_upper(L"Hello World!")<<endl;
+    wcout<<L"This is lower case "<<to_lower(L"Hello World!")<<endl;
+    wcout<<L"This is title case "<<to_title(L"Hello World!")<<endl;
+    wcout<<L"This is fold case "<<fold_case(L"Hello World!")<<endl;
+   
+}
+
+
+// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
+
+ + + + diff --git a/doc/html/working_with_multiple_locales.html b/doc/html/working_with_multiple_locales.html new file mode 100644 index 0000000..c0f1029 --- /dev/null +++ b/doc/html/working_with_multiple_locales.html @@ -0,0 +1,93 @@ + + + + +Boost.Locale: Working with multiple locales + + + + + + +
+
+
+ +

+ + + + Boost + C++ Libraries + +

+ +

+ + ...one of the most highly + regarded and expertly designed C++ library projects in the + world. + + Herb Sutter and Andrei + Alexandrescu, C++ + Coding Standards +

+
+
+ +
+ + +
+
+

Working with multiple locales

+
+
+

Boost.Locale allows you to work safely with multiple locales in the same process. As we mentioned before, the locale generation process is not a cheap one. Thus, when we work with multiple locales and need to switch between them, we recommend that you create all the locales you need when the program starts.

+

To simplify this process, the boost::locale::generator class has an option to cache all generated locales. With this option, when you create a locale that was previously generated, it would be fetched from the existing locale set instead. This operation is thread safe.

+

This option must be explicitly enabled by calling the locale_cache_enabled member function of boost::locale::generator with true as the parameter.

+

For example:

+
    generator gen;
+    gen.locale_cache_enabled(true);
+    gen("en_US.UTF-8");
+    gen("de_DE.UTF-8");
+    gen("ja_JP.UTF-8");
+    // Create all locales
+
+    std::locale en=gen("en_US.UTF-8"); 
+    // Fetch an existing locale from the cache
+    std::locale ar=gen("ar_EG.UTF-8");
+    // Because ar_EG not in the cache, a new locale is generated (and cached)
+

Then these locales can be imbued to iostreams or used directly as parameters to various functions.

+
+ + + diff --git a/doc/index.template.html b/doc/index.template.html new file mode 100644 index 0000000..7e47ca3 --- /dev/null +++ b/doc/index.template.html @@ -0,0 +1,16 @@ + + + + +Boost.Locale + + + + + + <body> + <a href="main.html">Frames are disabled. Click here to go to the main page.</a> + </body> + + + diff --git a/doc/locale_gen.txt b/doc/locale_gen.txt new file mode 100644 index 0000000..dc922a3 --- /dev/null +++ b/doc/locale_gen.txt @@ -0,0 +1,102 @@ +// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 filetype=cpp.doxygen +/*! +\page locale_gen Locale Generation + +Each locale is defined by a specific locale identifier, which contains a mandatory part (Language) and several optional parts +(Country, Variant, keywords and character encoding of \c std::string). Boost.Locale uses the POSIX naming convention for locales, +i.e. a locale is defined as language[_COUNTRY][.encoding][\@variant], where lang is ISO-639 language name like "en" or "ru", +COUNTRY is the ISO-3166 country identifier like "US" or "DE", encoding is the eight-bit character encoding like \c UTF-8 or \c ISO-8859-1, +and variant is additional options for specializing the locale, like \c euro or \c calendar=hebrew, see \ref locale_gen_variant. + +Note that each locale should include the encoding in order to handle \c char based strings correctly. + +\section locale_gen_basics Basics + +The class \ref boost::locale::generator "generator" provides tools to generate the locales we need. The simplest way to use +\c generator is to create a locale and set it as the global one: + +\code + #include + + using namespace boost::locale; + int main() + { + generator gen; + // Create locale generator + std::locale::global(gen("")); + // "" - the system default locale, set + // it globally + } +\endcode + +Of course we can also specify the locale manually + +\code + std::locale loc = gen("en_US.UTF-8"); + // Use English, United States locale +\endcode + +\note + +- Even if your application uses wide strings everywhere, you should specify the + 8-bit encoding to use for 8-bit stream IO operations like \c cout or \c fstream. + \n +- The default locale is defined by the environment variables \c LC_CTYPE , \c LC_ALL , and \c LANG + in that order (i.e. \c LC_CTYPE first and \c LANG last). On Windows, the library + also queries the \c LOCALE_USER_DEFAULT option in the Win32 API when these variables + are not set. + +\b Tip: Prefer using UTF-8 Unicode encoding over 8-bit encodings like the ISO-8859-X ones. + +By default the generated locales include all supported categories and character types. However, if your +application uses only 8-bit encodings, only wide-character encodings, or only specific facets, you can +limit the facet generation to specific categories and character types by calling the +\ref boost::locale::generator::categories() "categories" and \ref boost::locale::generator::characters() "characters" +member functions of the \ref boost::locale::generator "generator" class. + +For example: + +\code + generator gen; + gen.characters(wchar_t_facet); + gen.categories(collation_facet | formatting_facet); + std::locale::global(gen("de_DE.UTF-8")); +\endcode + +\section locale_gen_variant Variant + +The variant part of the locale (the part that comes after \@ symbol) is localization \ref using_localization_backends "back-end" dependent. + +\subsection locale_gen_variant_non_icu Non ICU Backends + +\ref posix_backend "POSIX" and \ref std_backend "std" back-ends use their own OS specific naming conventions and +depend on the current OS configuration. For example typical Linux distribution provides \c euro for currency selection, +\c cyrillic and \c latin for specification of language script. + +\ref winapi_backend "winapi" back-end does not support any variants. + +\subsection locale_gen_variant_icu ICU Backend + +ICU provides wide range of locale variant options. For detailed instructions read this +ICU manual pages. + +However in general it is represented as set of key=value pairs separated with a semicolon ";" For example: +"@collation=phonebook;calendar=islamic-civil". + +Currently ICU supports following keys: + +- \c calendar - the calendar used for the current locale. For example: \c gregorian, \c japanese, + \c buddhist, \c islamic, \c hebrew, \c chinese, \c islamic-civil. +- \c collation - the collation order used for this locales, for example \c phonebook, \c pinyin, \c traditional, + \c stroke, \c direct, \c posix. +- \c currency - the currency used in this locale, the standard 3 letter code like USD or JPY. +- \c numbers - the numbering system used, for example: \c latn, \c arab, \c thai. + +Please refer to CLDR and ICU documentation for exact list of keys and values: + +- ICU User Guide/Locale/Keywords +- Unicode Locale Data Markup Language + + +*/ + diff --git a/doc/locale_information.txt b/doc/locale_information.txt new file mode 100644 index 0000000..c2bd73b --- /dev/null +++ b/doc/locale_information.txt @@ -0,0 +1,27 @@ +// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 filetype=cpp.doxygen +/*! +\page locale_information Getting information about the current locale + +The \c std::locale::name function provides very limited information about a locale. Such a name is platform- +and compiler-dependent, and is useless for Boost.Locale. There is no way to change it, so for all locales +created by Boost.Locale, \c name() returns the same value as \c name() for \c std::locale::classic(). + +Thus an additional facet was created, giving more precise information: boost::locale::info. It has the following member functions: + +- \ref boost::locale::info::name() "std::string name()" -- the full name of the locale, for example \c en_US.UTF-8 +- \ref boost::locale::info::language() "std::string language()" -- the ISO-639 language code of the current locale, for example "en". +- \ref boost::locale::info::country() "std::string country()" -- the ISO-3199 country code of the current locale, for example "US". +- \ref boost::locale::info::variant() "std::string variant()" -- the variant of current locale, for example "euro". +- \ref boost::locale::info::encoding() "std::string encoding()" -- the encoding used for \c char based strings, for example "UTF-8" +- \ref boost::locale::info::utf8() "bool utf8()" -- a fast way to check whether the encoding is UTF-8. + +For example: + +\code + cout << "The language code is " << std::use_facet(some_locale).language() << endl; +\endcode + + +*/ + + diff --git a/doc/localized_text_formatting.txt b/doc/localized_text_formatting.txt new file mode 100644 index 0000000..ae8127d --- /dev/null +++ b/doc/localized_text_formatting.txt @@ -0,0 +1,160 @@ +// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 filetype=cpp.doxygen +/*! +\page localized_text_formatting Localized Text Formatting + +The \c iostream manipulators are very useful, but when we create a messages for the user, sometimes we need something +like good old \c printf or \c boost::format. + +Unfortunately \c boost::format has several limitations in context of localization: + +-# It renders all parameters using global locale rather than target \c ostream locale. For example: + \n + \code + std::locale::global(std::locale("en_US.UTF-8")); + output.imbue(std::locale("de_DE.UTF-8")) + output << boost::format("%1%") % 1234.345; + \endcode + \n + This would write "1,234.235" to output, instead of the "1.234,234" that is expected for "de_DE" locale +-# It knows nothing about the new Boost.Locale manipulators. +-# The \c printf-like syntax is very limited for formatting complex localized data, not allowing + the formatting of dates, times, or currencies + +Thus a new class, boost::locale::format, was introduced. For example: + +\code + wcout << wformat(L"Today {1,date} I would meet {2} at home") % time(0) % name <[0-9]+ -- digits, the index of the formatted parameter -- required. +- \c num or \c number -- format a number. Options are: + \n + - \c hex -- display in hexadecimal format + - \c oct -- display in octal format + - \c sci or \c scientific -- display in scientific format + - \c fix or \c fixed -- display in fixed format + \n + For example, \c number=sci +- \c cur or \c currency -- format currency. Options are: + \n + - \c iso -- display using ISO currency symbol. + - \c nat or \c national -- display using national currency symbol. + \n +- \c per or \c percent -- format a percentage value. +- \c date, \c time, \c datetime or \c dt -- format a date, a time, or a date and time. Options are: + \n + - \c s or \c short -- display in short format. + - \c m or \c medium -- display in medium format. + - \c l or \c long -- display in long format. + - \c f or \c full -- display in full format. +- \c ftime with string (quoted) parameter -- display as with \c strftime. See \c as::ftime manipulator. +- \c spell or \c spellout -- spell the number. +- \c ord or \c ordinal -- format an ordinal number (1st, 2nd... etc) +- \c left or \c < -- align-left. +- \c right or \c > -- align-right. +- \c width or \c w -- set field width (requires parameter). +- \c precision or \c p -- set precision (requires parameter). +- \c locale -- with parameter -- switch locales for the current operation. This command generates a locale + with formatting facets, giving more fine grained control of formatting. For example: + \n + \code + cout << format("This article was published at {1,date=l} (Gregorian) {1,locale=he_IL@calendar=hebrew,date=l} (Hebrew)") % date; + \endcode +- \c timezone or \c tz -- the name of the timezone to display the time in. For example:\n + \code + cout << format("Time is: Local {1,time}, ({1,time,tz=EET} Eastern European Time)") % date; + \endcode +- \c local - display the time in local time +- \c gmt - display the time in UTC time scale + \code + cout << format("Local time is: {1,time,local}, universal time is {1,time,gmt}") % time; + \endcode + +The constructor for the \ref boost::locale::format "format" class can take an object of type \ref boost::locale::message "message", simplifying integration with message translation code. + +For example: + +\code + cout<< format(translate("Adding {1} to {2}, we get {3}")) % a % b % (a+b) << endl; +\endcode + +A formatted string can be fetched directly by using the \ref boost::locale::format::str() "str(std::locale const &loc=std::locale())" member function. For example: + +\code + std::wstring de = (wformat(translate("Adding {1} to {2}, we get {3}")) % a % b % (a+b)).str(de_locale); + std::wstring fr = (wformat(translate("Adding {1} to {2}, we get {3}")) % a % b % (a+b)).str(fr_locale); +\endcode + + +\note There is one significant difference between \c boost::format and \c boost::locale::format: Boost.Locale's format converts its +parameters only when written to an \c ostream or when the `str()` member function is called. It only saves references to the objects that +can be written to a stream. + +This is generally not a problem when all operations are done in one statement, such as: + +\code + cout << format("Adding {1} to {2}, we get {3}") % a % b % (a+b); +\endcode + +Because the temporary value of \c (a+b) exists until the formatted data is actually written to the stream. But following code is wrong: + +\code + format fmt("Adding {1} to {2}, we get {3}"); + fmt % a; + fmt % b; + fmt % (a+b); + cout << fmt; +\endcode + +Because the temporary value of \c (a+b) no longer exists when \c fmt is written to the stream. A correct solution would be: + +\code + format fmt("Adding {1} to {2}, we get {3}"); + fmt % a; + fmt % b; + int a_plus_b = a+b; + fmt % a_plus_b; + cout << fmt; +\endcode + +*/ + + diff --git a/doc/main.txt b/doc/main.txt new file mode 100644 index 0000000..64aedf4 --- /dev/null +++ b/doc/main.txt @@ -0,0 +1,84 @@ +// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 filetype=cpp.doxygen + +/*! + +\mainpage Boost.Locale + +\section main_intro What is Boost.Locale? + +Boost.Locale is a library that provides high quality +localization facilities in a C++ way. + +It gives powerful tools for development of cross platform +localized software - the software that talks to user +in its language. + +Provided Features: + +- Correct case conversion, case folding and normalization. +- Collation (sorting), including support for 4 Unicode + collation levels. +- Date, time, timezone and calendar manipulations, + formatting and parsing, including transparent support + for calendars other than Gregorian. +- Boundary analysis for characters, words, sentences and + line-breaks. +- Number formatting, spelling and parsing. +- Monetary formatting and parsing. +- Powerful message formatting (string translation) + including support for plural forms, using GNU catalogs. +- Character set conversion. +- Transparent support for 8-bit character sets like Latin1 +- Support for \c char and \c wchar_t +- Experimental support for C++0x \c char16_t and \c char32_t + strings and streams. + +Boost.Locale enhances and unifies the standard library's API +the way it becomes useful and convenient for development +of cross platform and "cross-culture" software. + +In order to achieve this goal Boost.Locale uses +the-state-of-the-art Unicode and Localization +library: ICU - International Components for Unicode. + +Boost.Locale creates the natural glue between the C++ locales +framework, iostreams, and the powerful ICU library. + +Boost.Locale provides non-ICU based localization support as well. +It is based on the operating system native API or on the standard +C++ library support. Sacrificing some less important features, +Boost.Locale becomes less powerful but lighter and easier to deploy +and use library. + + +\section main_tutorial Tutorials + +- \subpage std_locales +- \subpage using_boost_locale + - \ref locale_gen + - \ref collation + - \ref conversions + - \ref formatting_and_parsing + - \ref messages_formatting + - \ref charset_handling + - \ref boundary_analysys + - \ref localized_text_formatting + - \ref dates_times_timezones + - \ref locale_information + - \ref working_with_multiple_locales +- \subpage using_localization_backends +- \subpage recommendations_and_myths +- \subpage building_boost_locale +- \subpage appendix + - \ref rationale + - \ref faq + - \ref default_encoding_under_windows + - \ref running_examples_under_windows + - \ref gettext_for_windows + - \ref glossary + - \ref tested_compilers_and_paltforms + - \ref status_of_cpp0x_characters_support + - \ref special_thanks + +*/ + diff --git a/doc/messages_formatting.txt b/doc/messages_formatting.txt new file mode 100644 index 0000000..43b5a4c --- /dev/null +++ b/doc/messages_formatting.txt @@ -0,0 +1,558 @@ +// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 filetype=cpp.doxygen +/*! +\page messages_formatting Messages Formatting (Translation) + +- \ref messages_formatting_into +- \ref msg_loading_dictionaries +- \ref message_translation + - \ref indirect_message_translation + - \ref plural_forms + - \ref multiple_gettext_domain + - \ref direct_message_translation +- \ref extracting_messages_from_code +- \ref custom_file_system_support +- \ref msg_non_ascii_keys +- \ref msg_qna + +\section messages_formatting_into Introduction + +Messages formatting is probably the most important part of +the localization - making your application speak in the user's language. + +Boost.Locale uses the GNU Gettext localization model. +We recommend you read the general documentation +of GNU Gettext, as it is outside the scope of this document. + +The model is following: + +- First, our application \c foo is prepared for localization by calling the \ref boost::locale::translate() "translate" function + for each message used in user interface. + \n + For example: + \code + cout << "Hello World" << endl; + \endcode + Is changed to + \n + \code + cout << translate("Hello World") << endl; + \endcode +- Then all messages are extracted from the source code and a special \c foo.po file is generated that contains all of the + original English strings. + \n + \verbatim + ... + msgid "Hello World" + msgstr "" + ... + \endverbatim +- The \c foo.po file is translated for the supported locales. For example, \c de.po, \c ar.po, \c en_CA.po , and \c he.po. + \n + \verbatim + ... + msgid "Hello World" + msgstr "שלום עולם" + \endverbatim + And then compiled to the binary \c mo format and stored in the following file structure: + \n + \verbatim + de + de/LC_MESSAGES + de/LC_MESSAGES/foo.mo + en_CA/ + en_CA/LC_MESSAGES + en_CA/LC_MESSAGES/foo.mo + ... + \endverbatim + \n + When the application starts, it loads the required dictionaries. Then when the \c translate function is called and the message is written + to an output stream, a dictionary lookup is performed and the localized message is written out instead. + +\section msg_loading_dictionaries Loading dictionaries + +All the dictionaries are loaded by the \ref boost::locale::generator "generator" class. +Using localized strings in the application, requires specification +of the following parameters: + +-# The search path of the dictionaries +-# The application domain (or name) + +This is done by calling the following member functions of the \ref boost::locale::generator "generator" class: + +- \ref boost::locale::generator::add_messages_path() "add_messages_path" - add the root path to the dictionaries. + \n + For example: if the dictionary is located at \c /usr/share/locale/ar/LC_MESSAGES/foo.mo, then path should be \c /usr/share/locale. + \n +- \ref boost::locale::generator::add_messages_domain() "add_messages_domain" - add the domain (name) of the application. In the above case it would be "foo". + +\note At least one domain and one path should be specified in order to load dictionaries. + +This is an example of our first fully localized program: + +\code +#include +#include + +using namespace std; +using namespace boost::locale; + +int main() +{ + generator gen; + + // Specify location of dictionaries + gen.add_messages_path("."); + gen.add_messages_domain("hello"); + + // Generate locales and imbue them to iostream + locale::global(gen("")); + cout.imbue(locale()); + + // Display a message using current system locale + cout << translate("Hello World") << endl; +} +\endcode + + +\section message_translation Message Translation + +There are two ways to translate messages: + +- using \ref boost_locale_translate_family "boost::locale::translate()" family of functions: + \n + These functions create a special proxy object \ref boost::locale::basic_message "basic_message" + that can be converted to string according to given locale or written to \c std::ostream + formatting the message in the \c std::ostream's locale. + \n + It is very convenient for working with \c std::ostream object and for postponing message + translation +- Using \ref boost_locale_gettext_family "boost::locale::gettext()" family of functions: + \n + These are functions that are used for direct message translation: they receive as a parameter + an original message or a key and convert it to the \c std::basic_string in given locale. + \n + These functions have similar names to thous used in the GNU Gettext library. + +\subsection indirect_message_translation Indirect Message Translation + +The basic function that allows us to translate a message is \ref boost_locale_translate_family "boost::locale::translate()" family of functions. + +These functions use a character type \c CharType as template parameter and receive either CharType const * or std::basic_string as input. + +These functions receive an original message and return a special proxy +object - \ref boost::locale::basic_message "basic_message". +This object holds all the required information for the message formatting. + +When this object is written to an output \c ostream, it performs a dictionary lookup of the message according to the locale +imbued in \c iostream. + +If the message is found in the dictionary it is written to the output stream, +otherwise the original string is written to the stream. + +For example: + +\code +// Translate a simple message "Hello World!" +std::cout << boost::locale::translate("Hello World!") << std::endl; +\endcode + +This allows the program to postpone translation of the message until the translation is actually needed, even to different +locale targets. + +\code +// Several output stream that we write a message to +// English, Japanese, Hebrew etc. +// Each one them has installed std::locale object that represents +// their specific locale +std::ofstream en,ja,he,de,ar; + +// Send single message to multiple streams +void send_to_all(message const &msg) +{ + // in each of the cases below + // the message is translated to different + // language + en << msg; + ja << msg; + he << msg; + de << msg; + ar << msg; +} + +int main() +{ + ... + send_to_all(translate("Hello World")); +} +\endcode + +\note + +- \ref boost::locale::basic_message "basic_message" can be implicitly converted + to an apopriate std::basic_string using + the global locale: + \n + \code + std::wstring msg = translate(L"Do you want to open the file?"); + \endcode +- \ref boost::locale::basic_message "basic_message" can be explicitly converted + to a string using the \ref boost::locale::basic_message::str() "str()" member function for a specific locale. + \n + \code + std::locale ru_RU = ... ; + std::string msg = translate("Do you want to open the file?").str(ru_RU); + \endcode + + +\subsection plural_forms Plural Forms + +GNU Gettext catalogs have simple, robust and yet powerful plural forms support. We recommend to read the +original GNU documentation here. + +Let's try to solve a simple problem, displaying a message to the user: + +\code + if(files == 1) + cout << translate("You have 1 file in the directory") << endl; + else + cout << format(translate("You have {1} files in the directory")) % files << endl; +\endcode + +This very simple task becomes quite complicated when we deal with languages other than English. Many languages have more +than two plural forms. For example, in Hebrew there are special forms for single, double, plural, and plural above 10. +They can't be distinguished by the simple rule "is n 1 or not" + +The correct solution is to give a translator an ability to choose a plural form on its own. Thus the translate +function can receive two additional parameters English plural form a number: translate(single,plural,count) + +For example: + +\code +cout << format(translate( "You have {1} file in the directory", + "You have {1} files in the directory", + files)) % files << endl; +\endcode + +A special entry in the dictionary specifies the rule to choose the correct plural form in the target language. +For example, the Slavic language family has 3 plural forms, that can be chosen using following equation: + +\code + plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2; +\endcode + +Such equation is stored in the message catalog itself and it is evaluated during translation to supply the correct form. + +So the code above would display 3 different forms in Russian locale for values of 1, 3 and 5: + +\verbatim +У вас есть 1 файл в каталоге +У вас есть 3 файла в каталоге +У вас есть 5 файлов в каталоге +\endverbatim + +And for Japanese that does not have plural forms at all it would display the same message +for any numeric value. + +For more detailed information please refer to GNU Gettext: 11.2.6 Additional functions for plural forms + + +\subsection adding_context_information Adding Context Information + +In many cases it is not sufficient to provide only the original English string to get the correct translation. +You sometimes need to provide some context information. In German, for example, a button labeled "open" is translated to +"öffnen" in the context of "opening a file", or to "aufbauen" in the context of opening an internet connection. + +In these cases you must add some context information to the original string, by adding a comment. + +\code +button->setLabel(translate("File","open")); +\endcode + +The context information is provided as the first parameter to the \ref boost::locale::translate() "translate" +function in both singular and plural forms. The translator would see this context information and would be able to translate the +"open" string correctly. + +For example, this is how the \c po file would look: + +\code +msgctxt "File" +msgid "open" +msgstr "öffnen" + +msgctxt "Internet Connection" +msgid "open" +msgstr "aufbauen" +\endcode + +\note Context information requires more recent versions of the gettext tools (>=0.15) for extracting strings and +formatting message catalogs. + + +\subsection multiple_gettext_domain Working with multiple messages domains + +In some cases it is useful to work with multiple message domains. + +For example, if an application consists of several independent modules, it may +have several domains - a separate domain for each module. + +For example, developing a FooBar office suite we might have: + +- a FooBar Word Processor, using the "foobarwriter" domain +- a FooBar Spreadsheet, using the "foobarspreadsheet" domain +- a FooBar Spell Checker, using the "foobarspell" domain +- a FooBar File handler, using the "foobarodt" domain + +There are three ways to use non-default domains: + +- When working with \c iostream, you can use the parameterized manipulator \ref + boost::locale::as::domain "as::domain(std::string const &)", which allows switching domains in a stream: + \n + \code + cout << as::domain("foo") << translate("Hello") << as::domain("bar") << translate("Hello"); + // First translation is taken from dictionary foo and the other from dictionary bar + \endcode +- You can specify the domain explicitly when converting a \c message object to a string: + \code + std::wstring foo_msg = translate(L"Hello World").str("foo"); + std::wstring bar_msg = translate(L"Hello World").str("bar"); + \endcode +- You can specify the domain directly using a \ref direct_message_translation "convenience" interface: + \code + MessageBox(dgettext("gui","Error Occurred")); + \endcode + +\subsection direct_message_translation Direct translation (Convenience Interface) + +Many applications do not write messages directly to an output stream or use only one locale in the process, so +calling translate("Hello World").str() for a single message would be annoying. Thus Boost.Locale provides +GNU Gettext-like localization functions for direct translation of the messages. However, unlike the GNU Gettext functions, +the Boost.Locale translation functions provide an additional optional parameter (locale), and support wide, u16 and u32 strings. + +The GNU Gettext like functions prototypes can be found \ref boost_locale_gettext_family "in this section". + + +All of these functions can have different prefixes for different forms: + +- \c d - translation in specific domain +- \c n - plural form translation +- \c p - translation in specific context + +\code + MessageBoxW(0,pgettext(L"File Dialog",L"Open?").c_str(),gettext(L"Question").c_str(),MB_YESNO); +\endcode + + +\section extracting_messages_from_code Extracting messages from the source code + +There are many tools to extract messages from the source code into the \c .po file format. The most +popular and "native" tool is \c xgettext which is installed by default on most Unix systems and freely downloadable +for Windows (see \ref gettext_for_windows). + +For example, we have a source file called \c dir.cpp that prints: + +\code + cout << translate("Listing of catalog {1}:") % file_name << endl; + cout << translate("Catalog {1} contains 1 file","Catalog {1} contains {2,num} files",files_no) + % file_name % files_no << endl; +\endcode + +Now we run: + +\verbatim +xgettext --keyword=translate:1,1t --keyword=translate:1,2,3t dir.cpp +\endverbatim + +And a file called \c messages.po created that looks like this (approximately): + +\code +#: dir.cpp:1 +msgid "Listing of catalog {1}:" +msgstr "" + +#: dir.cpp:2 +msgid "Catalog {1} contains 1 file" +msgid_plural "Catalog {1} contains {2,num} files" +msgstr[0] "" +msgstr[1] "" +\endcode + +This file can be given to translators to adapt it to specific languages. + +We used the \c --keyword parameter of \c xgettext to make it suitable for extracting messages from +source code localized with Boost.Locale, searching for translate() function calls instead of the default gettext() +and ngettext() ones. +The first parameter --keyword=translate:1,1t provides the template for basic messages: a \c translate function that is +called with 1 argument (1t) and the first message is taken as the key. The second one --keyword=translate:1,2,3t is used +for plural forms. +It tells \c xgettext to use a translate() function call with 3 parameters (3t) and take the 1st and 2nd parameter as keys. An +additional marker \c Nc can be used to mark context information. + +The full set of xgettext parameters suitable for Boost.Locale is: + +\code +xgettext --keyword=translate:1,1t --keyword=translate:1c,2,2t \ + --keyword=translate:1,2,3t --keyword=translate:1c,2,3,4t \ + --keyword=gettext:1 --keyword=pgettext:1c,2 \ + --keyword=ngettext:1,2 --keyword=npgettext:1c,2,3 \ + source_file_1.cpp ... source_file_N.cpp +\endcode + +Of course, if you do not use "gettext" like translation you +may ignore some of these parameters. + +\subsection custom_file_system_support Custom Filesystem Support + +When the access to actual file system is limited like in ActiveX controls or +when the developer wants to ship all-in-one executable file, +it is useful to be able to load \c gettext catalogs from a custom location - +a custom file system. + +Boost.Locale provides an option to install boost::locale::message_format facet +with customized options provided in boost::locale::gnu_gettext::messages_info structure. + +This structure contains \c boost::function based +\ref boost::locale::gnu_gettext::messages_info::callback_type "callback" +that allows user to provide custom functionality to load message catalog files. + +For example: + +\code +// Configure all options for message catalog +namespace blg = boost::locale::gnu_gettext; +blg::messages_info info; +info.language = "he"; +info.country = "IL"; +info.encoding="UTF-8"; +info.paths.push_back(""); // You need some even empty path +info.domains.push_back(blg::messages_info::domain("my_app")); +info.callback = some_file_loader; // Provide a callback + +// Create a basic locale without messages support +boost::locale::generator gen; +std::locale base_locale = gen("he_IL.UTF-8"); + +// Install messages catalogs for "char" support to the final locale +// we are going to use +std::locale real_locale(base_locale,blg::create_messages_facet(info)); +\endcode + +In order to setup \ref boost::locale::gnu_gettext::messages_info::language "language", \ref boost::locale::gnu_gettext::messages_info::country "country" and other members you may use \ref boost::locale::info facet for convenience, + +\code +// Configure all options for message catalog +namespace blg = boost::locale::gnu_gettext; +blg::messages_info info; + +info.paths.push_back(""); // You need some even empty path +info.domains.push_back(blg::messages_info::domain("my_app")); +info.callback = some_file_loader; // Provide a callback + +// Create an object with default locale +std::locale base_locale = gen(""); + +// Use boost::locale::info to configure all parameters + +boost::locale::info const &properties = std::use_facet(base_locale); +info.language = properties.language(); +info.country = properties.country(); +info.encoding = properties.encoding(); +info.variant = properties.variant(); + +// Install messages catalogs to the final locale +std::locale real_locale(base_locale,blg::create_messages_facet(info)); +\endcode + +\section msg_non_ascii_keys Non US-ASCII Keys + +Boost.Locale assumes that you use English for original text messages. And the best +practice is to use US-ASCII characters for original keys. + +However in some cases it us useful in insert some Unicode characters in text like +for example Copyright "©" character. + +As long as your narrow character string encoding is UTF-8 nothing further should be done. + +Boost.Locale assumes that your sources are encoded in UTF-8 and the input narrow +string use UTF-8 - which is the default for most compilers around (with notable +exception of Microsoft Visual C++). + +However if your narrow strings encoding in the source file is not UTF-8 but some other +encoding like windows-1252, the string would be misinterpreted. + +You can specify the character set of the original strings when you specify the +domain name for the application. + +\code +#include +#include + +using namespace std; +using namespace boost::locale; + +int main() +{ + generator gen; + + // Specify location of dictionaries + gen.add_messages_path("."); + // Specify the encoding of the source string + gen.add_messages_domain("copyrighted/windows-1255"); + + // Generate locales and imbue them to iostream + locale::global(gen("")); + cout.imbue(locale()); + + // In Windows 1255 (C) symbol is encoded as 0xA9 + cout << translate("© 2001 All Rights Reserved") << endl; +} +\endcode + +Thus if the programs runs in UTF-8 locale the copyright symbol would +be automatically converted to an appropriate UTF-8 sequence if the +key is missing in the dictionary. + + +\subsection msg_qna Questions and Answers + +- Do I need GNU Gettext to use Boost.Locale? + \n + Boost.Locale provides a run-time environment to load and use GNU Gettext message catalogs, but it does + not provide tools for generation, translation, compilation and management of these catalogs. + Boost.Locale only reimplements the GNU Gettext libintl. + \n + You would probably need: + \n + -# Boost.Locale itself -- for runtime. + -# A tool for extracting strings from source code, and managing them: GNU Gettext provides good tools, but other + implementations are available as well. + -# A good translation program like Lokalize, Pedit or GTranslator. + +- Why doesn't Boost.Locale provide tools for extracting and management of message catalogs. Why should + I use GPL-ed software? Are my programs or message catalogs affected by its license? + \n + -# Boost.Locale does not link to or use any of the GNU Gettext code, so you need not worry about your code as + the runtime library is fully reimplemented. + -# You may freely use GPL-ed software for extracting and managing catalogs, the same way as you are free to use + a GPL-ed editor. It does not affect your message catalogs or your code. + -# I see no reason to reimplement well debugged, working tools like \c xgettext, \c msgfmt, \c msgmerge that + do a very fine job, especially as they are freely available for download and support almost any platform. + All Linux distributions, BSD Flavors, Mac OS X and other Unix like operating systems provide GNU Gettext tools + as a standard package.\n + Windows users can get GNU Gettext utilities via MinGW project. See \ref gettext_for_windows. + + +- Is there any reason to prefer the Boost.Locale implementation to the original GNU Gettext runtime library? + In either case I would probably need some of the GNU tools. + \n + There are two important differences between the GNU Gettext runtime library and the Boost.Locale implementation: + \n + -# The GNU Gettext runtime supports only one locale per process. It is not thread-safe to use multiple locales + and encodings in the same process. This is perfectly fine for applications that interact directly with + a single user like most GUI applications, but is problematic for services and servers. + -# The GNU Gettext API supports only 8-bit encodings, making it irrelevant in environments that natively use + wide strings. + -# The GNU Gettext runtime library distributed under LGPL license which may be not convenient for some users. + +*/ + + diff --git a/doc/rationale.txt b/doc/rationale.txt new file mode 100644 index 0000000..9261dc4 --- /dev/null +++ b/doc/rationale.txt @@ -0,0 +1,230 @@ +// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 filetype=cpp.doxygen +/*! + +\page rationale Design Rationale + +- \ref rationale_why +- \ref why_icu +- \ref why_icu_wrapper +- \ref why_icu_api_is_hidden +- \ref why_gnu_gettext +- \ref why_posix_names +- \ref why_linear_chunks +- \ref why_abstract_api +- \ref why_no_special_character_type + +\section rationale_why Why is it needed? + +Why do we need a localization library, when standard C++ facets (should) provide most of the required functionality: + +- Case conversion is done using the \c std::ctype facet +- Collation is supported by \c std::collate and has nice integration with \c std::locale +- There are \c std::num_put , \c std::num_get , \c std::money_put , \c std::money_get , \c std::time_put and \c std::time_get for numbers, + time, and currency formatting and parsing. +- There is a \c std::messages class that supports localized message formatting. + +So why do we need such library if we have all the functionality within the standard library? + +Almost every(!) facet has design flaws: + +- \c std::collate supports only one level of collation, not allowing you to choose whether case- or accent-sensitive comparisons + should be performed. + +- \c std::ctype, which is responsible for case conversion, assumes that all conversions can be done on a per-character basis. This is + probably correct for many languages but it isn't correct in general. + \n + -# Case conversion may change a string's length. For example, the German word "grüßen" should be converted to "GRÜSSEN" in upper + case: the letter "ß" should be converted to "SS", but the \c toupper function works on a single-character basis. + -# Case conversion is context-sensitive. For example, the Greek word "ὈΔΥΣΣΕΎΣ" should be converted to "ὀδυσσεύς", where the Greek letter + "Σ" is converted to "σ" or to "ς", depending on its position in the word. + -# Case conversion cannot assume that a character is a single code point, which is incorrect for both the UTF-8 and UTF-16 encodings, + where individual code-points are represented by up to 4 \c char 's or two \c wchar_t 's on the Windows platform. This makes + \c std::ctype totally useless with these encodings. +- \c std::numpunct and \c std::moneypunct do not specify the code points for digit representation at all, + so they cannot format numbers with the digits used under Arabic locales. For example, + the number "103" is expected to be displayed as "١٠٣" in the \c ar_EG locale. + \n + \c std::numpunct and \c std::moneypunct assume that the thousands separator is a single character. This is untrue + for the UTF-8 encoding where only Unicode 0-0x7F range can be represented as a single character. As a result, localized numbers can't be + represented correctly under locales that use the Unicode "EN SPACE" character for the thousands separator, such as Russian. + \n + This actually causes real problems under GCC and SunStudio compilers, where formatting numbers under a Russian locale creates invalid + UTF-8 sequences. +- \c std::time_put and \c std::time_get have several flaws: + -# They assume that the calendar is always Gregorian, by using \c std::tm for time representation, ignoring the fact that in many + countries dates may be displayed using different calendars. + -# They always use a global time zone, not allowing specification of the time zone for formatting. The standard \c std::tm doesn't + even include a timezone field at all. + -# \c std::time_get is not symmetric with \c std::time_put, so you cannot parse dates and times created with \c std::time_put . + (This issue is addressed in C++0x and some STL implementation like the Apache standard C++ library.) +- \c std::messages does not provide support for plural forms, making it impossible to correctly localize such simple strings as + "There are X files in the directory". + +Also, many features are not really supported by \c std::locale at all: timezones (as mentioned above), text boundary analysis, number +spelling, and many others. So it is clear that the standard C++ locales are problematic for real-world applications. + +\section why_icu Why use an ICU wrapper instead of ICU? + +ICU is a very good localization library, but it has several serious flaws: + +- It is absolutely unfriendly to C++ developers. It ignores popular C++ idioms (the STL, RTTI, exceptions, etc), instead +mostly mimicking the Java API. +- It provides support for only one kind of string, UTF-16, when some users may want other Unicode encodings. +For example, for XML or HTML processing UTF-8 is much more convenient and UTF-32 easier to use. Also there is no support for +"narrow" encodings that are still very popular, such as the ISO-8859 encodings. + +For example: Boost.Locale provides direct integration with \c iostream allowing a more natural way of data formatting. For example: + +\code + cout << "You have "<