size_t should be used for size of objects, which wxGetTranslation() and
wxTranslations::GetString() 'n' argument isn't -- it's just a regular
integer.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64215
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// plural form version of the same:
const wxString& GetString(const wxString& origString,
const wxString& origString2,
// plural form version of the same:
const wxString& GetString(const wxString& origString,
const wxString& origString2,
const wxString& domain = wxEmptyString) const
{
return wxGetTranslation(origString, origString2, n, domain);
const wxString& domain = wxEmptyString) const
{
return wxGetTranslation(origString, origString2, n, domain);
const wxString& domain = wxEmptyString) const;
const wxString& GetString(const wxString& origString,
const wxString& origString2,
const wxString& domain = wxEmptyString) const;
const wxString& GetString(const wxString& origString,
const wxString& origString2,
const wxString& domain = wxEmptyString) const;
wxString GetHeaderValue(const wxString& header,
const wxString& domain = wxEmptyString) const;
wxString GetHeaderValue(const wxString& header,
inline const wxString& wxGetTranslation(const wxString& str1,
const wxString& str2,
inline const wxString& wxGetTranslation(const wxString& str1,
const wxString& str2,
const wxString& domain = wxEmptyString)
{
wxTranslations *trans = wxTranslations::Get();
const wxString& domain = wxEmptyString)
{
wxTranslations *trans = wxTranslations::Get();
const wxString& domain = wxEmptyString) const;
/**
const wxString& domain = wxEmptyString) const;
/**
- Calls wxTranslations::GetString(const wxString&, const wxString&, size_t, const wxString&) const.
+ Calls wxTranslations::GetString(const wxString&, const wxString&, unsigned, const wxString&) const.
*/
virtual const wxString& GetString(const wxString& origString,
*/
virtual const wxString& GetString(const wxString& origString,
- const wxString& origString2, size_t n,
+ const wxString& origString2, unsigned n,
const wxString& domain = wxEmptyString) const;
/**
const wxString& domain = wxEmptyString) const;
/**
*/
const wxString& GetString(const wxString& origString,
const wxString& origString2,
*/
const wxString& GetString(const wxString& origString,
const wxString& origString2,
const wxString& domain = wxEmptyString) const;
/**
const wxString& domain = wxEmptyString) const;
/**
extracted to the message catalog. Instead, use the _() and wxPLURAL()
macro for all literal strings.
extracted to the message catalog. Instead, use the _() and wxPLURAL()
macro for all literal strings.
- @see wxGetTranslation(const wxString&, const wxString&, size_t, const wxString&)
+ @see wxGetTranslation(const wxString&, const wxString&, unsigned, const wxString&)
@header{wx/intl.h}
*/
const wxString& wxGetTranslation(const wxString& string,
@header{wx/intl.h}
*/
const wxString& wxGetTranslation(const wxString& string,
- const wxString& plural, size_t n,
+ const wxString& plural, unsigned n,
const wxString& domain = wxEmptyString);
/**
const wxString& domain = wxEmptyString);
/**
public:
wxPluralFormsNode(const wxPluralFormsToken& token) : m_token(token) {}
const wxPluralFormsToken& token() const { return m_token; }
public:
wxPluralFormsNode(const wxPluralFormsToken& token) : m_token(token) {}
const wxPluralFormsToken& token() const { return m_token; }
- const wxPluralFormsNode* node(size_t i) const
+ const wxPluralFormsNode* node(unsigned i) const
{ return m_nodes[i].get(); }
{ return m_nodes[i].get(); }
- void setNode(size_t i, wxPluralFormsNode* n);
- wxPluralFormsNode* releaseNode(size_t i);
+ void setNode(unsigned i, wxPluralFormsNode* n);
+ wxPluralFormsNode* releaseNode(unsigned i);
wxPluralFormsToken::Number evaluate(wxPluralFormsToken::Number n) const;
private:
wxPluralFormsToken::Number evaluate(wxPluralFormsToken::Number n) const;
private:
-void wxPluralFormsNode::setNode(size_t i, wxPluralFormsNode* n)
+void wxPluralFormsNode::setNode(unsigned i, wxPluralFormsNode* n)
-wxPluralFormsNode* wxPluralFormsNode::releaseNode(size_t i)
+wxPluralFormsNode* wxPluralFormsNode::releaseNode(unsigned i)
{
return m_nodes[i].release();
}
{
return m_nodes[i].release();
}
wxString GetDomain() const { return m_domain; }
// get the translated string: returns NULL if not found
wxString GetDomain() const { return m_domain; }
// get the translated string: returns NULL if not found
- const wxString *GetString(const wxString& sz, size_t n = size_t(-1)) const;
+ const wxString *GetString(const wxString& sz, unsigned n = UINT_MAX) const;
// public variable pointing to the next element in a linked list (or NULL)
wxMsgCatalog *m_pNext;
// public variable pointing to the next element in a linked list (or NULL)
wxMsgCatalog *m_pNext;
-const wxString *wxMsgCatalog::GetString(const wxString& str, size_t n) const
+const wxString *wxMsgCatalog::GetString(const wxString& str, unsigned n) const
{
index = m_pluralFormsCalculator->evaluate(n);
}
{
index = m_pluralFormsCalculator->evaluate(n);
}
const wxString& wxTranslations::GetString(const wxString& origString,
const wxString& domain) const
{
const wxString& wxTranslations::GetString(const wxString& origString,
const wxString& domain) const
{
- return GetString(origString, origString, size_t(-1), domain);
+ return GetString(origString, origString, UINT_MAX, domain);
}
const wxString& wxTranslations::GetString(const wxString& origString,
const wxString& origString2,
}
const wxString& wxTranslations::GetString(const wxString& origString,
const wxString& origString2,
const wxString& domain) const
{
if ( origString.empty() )
const wxString& domain) const
{
if ( origString.empty() )
return GetUntranslatedString(origString);
else
return GetUntranslatedString(n == 1 ? origString : origString2);
return GetUntranslatedString(origString);
else
return GetUntranslatedString(n == 1 ? origString : origString2);
if ( pMsgCat == NULL )
return wxEmptyString;
if ( pMsgCat == NULL )
return wxEmptyString;
- trans = pMsgCat->GetString(wxEmptyString, (size_t)-1);
+ trans = pMsgCat->GetString(wxEmptyString, UINT_MAX);
}
else
{
// search in all domains
for ( pMsgCat = m_pMsgCat; pMsgCat != NULL; pMsgCat = pMsgCat->m_pNext )
{
}
else
{
// search in all domains
for ( pMsgCat = m_pMsgCat; pMsgCat != NULL; pMsgCat = pMsgCat->m_pNext )
{
- trans = pMsgCat->GetString(wxEmptyString, (size_t)-1);
+ trans = pMsgCat->GetString(wxEmptyString, UINT_MAX);
if ( trans != NULL ) // take the first found
break;
}
if ( trans != NULL ) // take the first found
break;
}