// Like Stroka::Quote(), but does not quote digits-only string
static Stroka QuoteForHelp(const Stroka& str) {
    if (str.empty())
        return str.Quote();
    for (size_t i = 0; i < str.size(); ++i) {
        if (!isdigit(str[i]))
            return str.Quote();
    }
    return str;
}
Exemple #2
0
void ChDir(const Stroka& path) {
#ifdef _win_
    bool ok = SetCurrentDirectory(~path);
#else
    bool ok = !chdir(~path);
#endif
    if (!ok)
        ythrow TSystemError() << "failed to change directory to " << path.Quote();
}