Exemplo n.º 1
0
void TStreamStackOutputFileFactory
    ::DoOpen(TStreamStackOutput& stack, const TStringBuf& file)
{
    if (file.empty())
        stack.Push(Cout);
    else {
        // this is unbuffered
        stack.Push(new TFileOutput(Stroka(file)));
        if (!ExtensionMap.Push(stack, file))
            stack.Push(new TBufferedOutput(stack));
    }
}
Exemplo n.º 2
0
TOpts::TOpts(const TStringBuf& optstring)
    : ArgPermutation_(DEFAULT_ARG_PERMUTATION)
    , AllowSingleDashForLong_(false)
    , AllowPlusForLong_(false)
    , AllowUnknownCharOptions_(false)
    , AllowUnknownLongOptions_(false)
    , FreeArgsMin_(0)
    , FreeArgsMax_(Max<ui32>()) {
    if (!optstring.empty()) {
        AddCharOptions(optstring);
    }
    AddVersionOption(0);
}