Lines Matching defs:name
32 static inline bool is_C_locale_name (const char* name)
33 { return ((name[0] == 'C') && (name[1] == 0)); }
59 { _STLP_THROW(runtime_error("Invalid null locale name")); }
61 void _STLP_CALL locale::_M_throw_on_combine_error(const string& name) {
64 what += name.empty() ? "system" : name.c_str();
70 const char* name, const char* facet) {
77 what += name[0] == 0 ? "system" : name;
82 what += name[0] == 0 ? "system" : name;
89 what += " from name '";
90 what += name;
137 // Create a locale from a name.
138 locale::locale(const char* name)
140 if (!name)
143 if (is_C_locale_name(name)) {
150 impl = new _Locale_impl(locale::id::_S_max, name);
154 const char* ctype_name = name;
156 const char* numeric_name = name;
158 const char* time_name = name;
160 const char* collate_name = name;
162 const char* monetary_name = name;
164 const char* messages_name = name;
173 // Try to use a normalize locale name in order to have the == operator
180 impl->name = ctype_name;
182 // else we keep current name.
191 const char* name,
199 L->name = string("LC_CTYPE=") + _Locale_extract_ctype_name((c & locale::ctype) ? ctype_name : name, buf, 0, &__err_code) + ";";
200 L->name += string("LC_TIME=") + _Locale_extract_time_name((c & locale::time) ? time_name : name, buf, 0, &__err_code) + ";";
201 L->name += string("LC_NUMERIC=") + _Locale_extract_numeric_name((c & locale::numeric) ? numeric_name : name, buf, 0, &__err_code) + ";";
202 L->name += string("LC_COLLATE=") + _Locale_extract_collate_name((c & locale::collate) ? collate_name : name, buf, 0, &__err_code) + ";";
203 L->name += string("LC_MONETARY=") + _Locale_extract_monetary_name((c & locale::monetary) ? monetary_name : name, buf, 0, &__err_code) + ";";
204 L->name += string("LC_MESSAGES=") + _Locale_extract_messages_name((c & locale::messages) ? messages_name : name, buf, 0, &__err_code);
207 // Give L a name where all facets except those in category c
213 L->name = name1;
215 L->name = name2;
222 const char* name,
226 if ((c & locale::all) == 0 || (strcmp(name, ctype_name) == 0 &&
227 strcmp(name, time_name) == 0 &&
228 strcmp(name, numeric_name) == 0 &&
229 strcmp(name, collate_name) == 0 &&
230 strcmp(name, monetary_name) == 0 &&
231 strcmp(name, messages_name) == 0))
232 L->name = name;
238 L->name = ctype_name;
240 _Stl_loc_combine_names_aux(L, name, ctype_name, time_name, numeric_name, collate_name, monetary_name, messages_name, c);
246 // in category c are instead constructed by name.
247 locale::locale(const locale& L, const char* name, locale::category c)
249 if (!name)
252 if (!::strcmp(_Nameless, name))
253 _STLP_THROW(runtime_error("Invalid locale name '" _NAMELESS "'"));
261 const char* ctype_name = name;
263 const char* numeric_name = name;
265 const char* time_name = name;
267 const char* collate_name = name;
269 const char* monetary_name = name;
271 const char* messages_name = name;
286 _Stl_loc_combine_names(impl, L._M_impl->name.c_str(),
302 if (L1.name() != _Nameless && L2.name() != _Nameless)
303 _Stl_loc_combine_names(impl, L1._M_impl->name.c_str(), L2._M_impl->name.c_str(), c);
305 impl->name = _Nameless;
389 string locale::name() const {
390 return _M_impl->name;
396 (this->name() == L.name() && this->name() != _Nameless);
422 if (L.name() != _Nameless)
423 setlocale(LC_ALL, L.name().c_str());