added: to misc: UrlEncode which takes PT::TextStreamBase as an argument

added: to misc: QEncode which takes PT::TextStreamBase as an argument
added: to Locale: methods: IsKey, Get which takes PT::TextStreamBase as an argument




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@860 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2012-07-10 16:50:59 +00:00
parent f76a0ca3e9
commit 9830b0a50f
16 changed files with 2413 additions and 1705 deletions

View File

@@ -13,6 +13,7 @@
#include <vector>
#include <string>
#include "space/spaceparser.h"
#include "textstream/textstream.h"
@@ -56,17 +57,29 @@ public:
bool IsKey(const wchar_t * key, bool try_default_too = true);
bool IsKey(const std::wstring & key, bool try_default_too = true) const;
template<typename char_type, size_t stack_size, size_t heap_block_size>
bool IsKey(const PT::TextStreamBase<char_type, stack_size, heap_block_size> & key,
bool try_default_too = true);
// checking whether there is a 'key' in the lang_id language
// or in the default language if try_default_too is true
bool IsKey(const wchar_t * key, size_t lang_id, bool try_default_too = true);
bool IsKey(const std::wstring & key, size_t lang_id, bool try_default_too = true) const;
template<typename char_type, size_t stack_size, size_t heap_block_size>
bool IsKey(const PT::TextStreamBase<char_type, stack_size, heap_block_size> & key,
size_t lang_id, bool try_default_too = true);
// returning a value for a specific key
const std::wstring & Get(const wchar_t * key, bool try_default_too = true);
const std::wstring & Get(const wchar_t * key, size_t lang_id, bool try_default_too = true);
const std::wstring & Get(const std::wstring & key, bool try_default_too = true) const;
const std::wstring & Get(const std::wstring & key, size_t lang_id, bool try_default_too = true) const;
template<typename char_type, size_t stack_size, size_t heap_block_size>
const std::wstring & Get(const PT::TextStreamBase<char_type, stack_size, heap_block_size> & key,
bool try_default_too = true);
// lists
// current limitation:
// we are looking only in 'space.table' so lists with only one item are not found
@@ -194,4 +207,34 @@ private:
};
template<typename char_type, size_t stack_size, size_t heap_block_size>
bool Locale::IsKey(const PT::TextStreamBase<char_type, stack_size, heap_block_size> & key,
bool try_default_too)
{
key.to_string(key_str);
return IsKey(key_str, try_default_too);
}
template<typename char_type, size_t stack_size, size_t heap_block_size>
bool Locale::IsKey(const PT::TextStreamBase<char_type, stack_size, heap_block_size> & key,
size_t lang_id, bool try_default_too)
{
key.to_string(key_str);
return IsKey(key_str, lang_id, try_default_too);
}
template<typename char_type, size_t stack_size, size_t heap_block_size>
const std::wstring & Locale::Get(const PT::TextStreamBase<char_type, stack_size, heap_block_size> & key,
bool try_default_too)
{
key.to_string(key_str);
return Get(key_str, try_default_too);
}
#endif