From 650ad13a3031866e283654c67321dfa5b5b4eb78 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 12 Oct 2016 18:40:07 +0200 Subject: [PATCH] lang >> locale --- lib/libZRCola/include/zrcola/character.h | 4 ++-- lib/libZRCola/include/zrcola/tag.h | 26 +++++++++++------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/lib/libZRCola/include/zrcola/character.h b/lib/libZRCola/include/zrcola/character.h index fe3265e..13ea23a 100644 --- a/lib/libZRCola/include/zrcola/character.h +++ b/lib/libZRCola/include/zrcola/character.h @@ -238,8 +238,8 @@ namespace ZRCola { /// \param[in ] cats Set of categories, character must be a part of /// \param[inout] hits (character, count) map to append full-word hits to /// \param[inout] hits_sub (character, count) map to append partial-word hits to - /// \param[in] fn_abort Pointer to function to periodically test for search cancellation - /// \param[in] cookie Cookie for \p fn_abort call + /// \param[in ] fn_abort Pointer to function to periodically test for search cancellation + /// \param[in ] cookie Cookie for \p fn_abort call /// bool Search(_In_z_ const wchar_t *str, _In_ const std::set &cats, _Inout_ std::map &hits, _Inout_ std::map &hits_sub, _In_opt_ bool (__cdecl *fn_abort)(void *cookie) = NULL, _In_opt_ void *cookie = NULL) const; diff --git a/lib/libZRCola/include/zrcola/tag.h b/lib/libZRCola/include/zrcola/tag.h index fbd7c1f..c7b8220 100644 --- a/lib/libZRCola/include/zrcola/tag.h +++ b/lib/libZRCola/include/zrcola/tag.h @@ -188,14 +188,14 @@ namespace ZRCola { /// struct tagname { tagid_t tag; ///< Tag ID - LCID lang; ///< Language ID + LCID locale; ///< Locale ID unsigned __int16 name_len; ///< \c name length (in characters) wchar_t name[]; ///< Tag localized name /// /// Compares two names /// - /// \param[in] lcid Locale ID to use for compare + /// \param[in] locale Locale ID to use for compare /// \param[in] str_a First name /// \param[in] count_a Number of characters in string \p str_a /// \param[in] str_b Second name @@ -210,9 +210,9 @@ namespace ZRCola { /// The function does not treat \\0 characters as terminators for performance reasons. /// Therefore \p count_a and \p count_b must represent exact string lengths. /// - static inline int CompareName(LCID lcid, const wchar_t *str_a, unsigned __int16 count_a, const wchar_t *str_b, unsigned __int16 count_b) + static inline int CompareName(LCID locale, const wchar_t *str_a, unsigned __int16 count_a, const wchar_t *str_b, unsigned __int16 count_b) { - switch (CompareString(lcid, LINGUISTIC_IGNORECASE | LINGUISTIC_IGNOREDIACRITIC | NORM_LINGUISTIC_CASING | NORM_IGNOREWIDTH, str_a, count_a, str_b, count_b)) { + switch (CompareString(locale, LINGUISTIC_IGNORECASE | LINGUISTIC_IGNOREDIACRITIC | NORM_LINGUISTIC_CASING | NORM_IGNOREWIDTH, str_a, count_a, str_b, count_b)) { case CSTR_LESS_THAN : return -1; case CSTR_EQUAL : return 0; case CSTR_GREATER_THAN: return 1; @@ -231,8 +231,8 @@ namespace ZRCola { /// /// Constructs the index /// - /// \param[in] h Reference to vector holding the data - /// \param[in] lcid Locale used to perform tag name comparison + /// \param[in] h Reference to vector holding the data + /// \param[in] locale Locale used to perform tag name comparison /// indexName(_In_ std::vector &h) : index(h) {} @@ -249,10 +249,10 @@ namespace ZRCola { /// virtual int compare(_In_ const tagname &a, _In_ const tagname &b) const { - if (a.lang < b.lang) return -1; - else if (a.lang > b.lang) return 1; + if (a.locale < b.locale) return -1; + else if (a.locale > b.locale) return 1; - int r = tagname::CompareName(a.lang, a.name, a.name_len, b.name, b.name_len); + int r = tagname::CompareName(a.locale, a.name, a.name_len, b.name, b.name_len); if (r != 0) return r; return 0; @@ -271,10 +271,10 @@ namespace ZRCola { /// virtual int compare_sort(_In_ const tagname &a, _In_ const tagname &b) const { - if (a.lang < b.lang) return -1; - else if (a.lang > b.lang) return 1; + if (a.locale < b.locale) return -1; + else if (a.locale > b.locale) return 1; - int r = tagname::CompareName(a.lang, a.name, a.name_len, b.name, b.name_len); + int r = tagname::CompareName(a.locale, a.name, a.name_len, b.name, b.name_len); if (r != 0) return r; if (a.tag < b.tag) return -1; @@ -290,8 +290,6 @@ namespace ZRCola { /// /// Constructs the database /// - /// \param[in] lcid Locale used to perform tag name comparison - /// inline tagname_db() : idxName(data) {} };