}
// be careful: empty if unset
- const std::string & getValue(void) const throw() {
+ const std::string & getValue(void) const {
return (a_value);
}
- bool isInitialized(void) const throw() {
+ bool isInitialized(void) const {
return (a_initialized);
}
//Unset is when getenv("TZ") returns NULL. Then, /etc/localtime used to be a copy or symlink to
// any of the /usr/share/zoneinfo available timezones.
- bool unsetTZ(void) const throw() { return (a_unsetTZ); }
+ bool unsetTZ(void) const { return (a_unsetTZ); }
- bool apply() const throw() {
+ bool apply() const {
// http://stackoverflow.com/questions/5873029/questions-about-putenv-and-setenv
if(unsetTZ()) {
- unsetenv("TZ");
- }
- else {
- setenv("TZ", a_value.c_str(), 1 /* overwrite */);
+ unsetenv("TZ");
+ }
+ else {
+ setenv("TZ", a_value.c_str(), 1 /* overwrite */);
/*
// If TZ has an invalid setting, tzset() uses GMT0:
if (!success) std::cerr << "Invalid TZ '" << a_value << "'. Probably GMT0 is going to be used instead !" << std::endl;
return success;
*/
- }
+ }
return true;
}
- std::string asString() const throw() {
+ std::string asString() const {
std::string result = getValue();
- if (unsetTZ()) return "<TZ unset>";
- if (result == "") return "<TZ empty>";
+ if (unsetTZ()) return "[TZ unset]";
+ if (result == "") return "[TZ empty]";
return result;
}
};