Files
cppdraft_translate/cppdraft/locale/convenience.md
2025-10-25 03:02:53 +03:00

65 lines
2.7 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[locale.convenience]
# 28 Text processing library [[text]](./#text)
## 28.3 Localization library [[localization]](localization#locale.convenience)
### 28.3.3 Locales [[locales]](locales#locale.convenience)
#### 28.3.3.3 Convenience interfaces [locale.convenience]
#### [28.3.3.3.1](#classification) Character classification [[classification]](classification)
[🔗](#lib:isspace)
`template<class charT> bool isspace (charT c, const locale& loc);
template<class charT> bool isprint (charT c, const locale& loc);
template<class charT> bool iscntrl (charT c, const locale& loc);
template<class charT> bool isupper (charT c, const locale& loc);
template<class charT> bool islower (charT c, const locale& loc);
template<class charT> bool isalpha (charT c, const locale& loc);
template<class charT> bool isdigit (charT c, const locale& loc);
template<class charT> bool ispunct (charT c, const locale& loc);
template<class charT> bool isxdigit(charT c, const locale& loc);
template<class charT> bool isalnum (charT c, const locale& loc);
template<class charT> bool isgraph (charT c, const locale& loc);
template<class charT> bool isblank (charT c, const locale& loc);
`
[1](#classification-1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1240)
Each of these functions is*F* returns the result of the expression:use_facet<ctype<charT>>(loc).is(ctype_base::*F*, c) where *F* is the ctype_base::mask value
corresponding to that function ([[category.ctype]](category.ctype "28.3.4.2The ctype category"))[.](#classification-1.sentence-1)[216](#footnote-216 "When used in a loop, it is faster to cache the ctype&lt;> facet and use it directly, or use the vector form of ctype&lt;>::is.")
[216)](#footnote-216)[216)](#footnoteref-216)
When used in a loop,
it is faster to cache the ctype<> facet and use it directly, or
use the vector form of ctype<>::is[.](#footnote-216.sentence-1)
#### [28.3.3.3.2](#conversions.character) Character conversions [[conversions.character]](conversions.character)
[🔗](#lib:toupper)
`template<class charT> charT toupper(charT c, const locale& loc);
`
[1](#conversions.character-1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1262)
*Returns*: use_facet<ctype<charT>>(loc).toupper(c)[.](#conversions.character-1.sentence-1)
[🔗](#lib:tolower)
`template<class charT> charT tolower(charT c, const locale& loc);
`
[2](#conversions.character-2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1273)
*Returns*: use_facet<ctype<charT>>(loc).tolower(c)[.](#conversions.character-2.sentence-1)