当前位置: 首页>>代码示例>>C++>>正文


C++ Stroka::to_lower方法代码示例

本文整理汇总了C++中Stroka::to_lower方法的典型用法代码示例。如果您正苦于以下问题:C++ Stroka::to_lower方法的具体用法?C++ Stroka::to_lower怎么用?C++ Stroka::to_lower使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Stroka的用法示例。


在下文中一共展示了Stroka::to_lower方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetOutputFileName

Stroka CCommonParm::GetOutputFileName() const {
    if (NULL != Config.Get() && Config->has_output() && Config->output().has_file()) {
        Stroka fn = Config->output().GetFile();
        fn.to_lower();
        if ("stdout" == fn)
            return "-";
        return Config->output().GetFile();
    }

    return Stroka("-");
}
开发者ID:Frankie-666,项目名称:tomita-parser,代码行数:11,代码来源:commonparm.cpp

示例2: GetPrettyOutputFileName

Stroka CCommonParm::GetPrettyOutputFileName() const {
    if (NULL != Config.Get() && Config->has_prettyoutput()) {
        Stroka fn = Config->GetPrettyOutput();
        fn.to_lower();
        if ("stdout" == fn || "stderr" == fn)
            return fn;
        if ("-" == fn)
            return "stdout";
        if (fn.size() > 0)
            return Config->GetPrettyOutput();
    }

    return Stroka("");
}
开发者ID:Frankie-666,项目名称:tomita-parser,代码行数:14,代码来源:commonparm.cpp

示例3: AnalizeParameter

void CCommonParm::AnalizeParameter(const TStringBuf& name, const TStringBuf& value) {
    Stroka paramName = ToString(StripString(name));
    Stroka paramValue = ToString(StripString(value));

    paramName.to_lower();
}
开发者ID:Frankie-666,项目名称:tomita-parser,代码行数:6,代码来源:commonparm.cpp

示例4: ParseConfig

bool CCommonParm::ParseConfig(const Stroka& fn) {
    Config.Reset(NProtoConf::LoadFromFile<TTextMinerConfig>(fn));
    if (!Config)
        ythrow yexception() << "Cannot read the config from \"" << fn << "\".";

    if (m_args.has(OPT_BINARY_DIR)) {
        if (Config->has_binarydir() && Config->binarydir().length() > 0)
            ythrow yexception() << "Both \"--" << OPT_BINARY_DIR << "\" command line argument and \"BinaryDir\" config parameter specified";

        Config->set_binarydir(m_args[OPT_BINARY_DIR]);
    }

    if (Config->has_input()) {
        TTextMinerConfig_TInputParams inputParams = Config->input();

        if (inputParams.has_file() && !inputParams.file().empty()
            && inputParams.has_dir() && !inputParams.dir().empty())
            ythrow yexception() << "Input\\File and Input\\Dir options are meaningless together";

        Stroka fn = inputParams.file();
        fn.to_lower();
        if (fn.empty() || "stdin" == fn || "-" == fn)
            m_strInputFileName = "";
        else
            m_strInputFileName = inputParams.file();

        if (inputParams.has_dir()) {
            if (inputParams.has_type())
                ythrow yexception() << "Input\\Type field is meaningless for directory processing";

            m_strSourceType = "dir";
            m_strInputFileName = inputParams.dir();
            m_strDocDir = inputParams.dir();
            if (!PathHelper::IsDir(m_strDocDir))
                ythrow yexception() << "\"" << m_strDocDir << "\" isn't a directory";
        } else {
            if (inputParams.has_type()) {
                switch (inputParams.type()) {
                    case TTextMinerConfig::TInputParams::no:
                        m_strSourceType = "no";
                        break;

                    case TTextMinerConfig::TInputParams::dpl:
                        m_strSourceType = "dpl";
                        break;

                    case TTextMinerConfig::TInputParams::arcview:
                        m_strSourceType = "arcview";
                        break;

                    case TTextMinerConfig::TInputParams::mapreduce:
                        m_strSourceType = "mapreduce";
                        break;

                    case TTextMinerConfig::TInputParams::tar:
                        if (m_strInputFileName.empty())
                            ythrow yexception() << "Please specify Input\\File field in configuration file in order to use .tar archive.";
                        m_strSourceType = "tar";
                        break;

                    case TTextMinerConfig::TInputParams::som:
                        if (m_strInputFileName.empty())
                            ythrow yexception() << "Please specify Input\\File field in configuration file in order to read SOM data.";
                        m_strSourceType = "som";
                        break;

                    case TTextMinerConfig::TInputParams::yarchive:
                        if (m_strInputFileName.empty())
                            ythrow yexception() << "Please specify Input\\File field in configuration file in order to read Yandex archive.";
                        m_strSourceType = "yarchive";
                        break;

                    default:
                        ythrow yexception() << "This type of input isn't supported";
                }
            } else
                m_strSourceType = "no";
        }
    }

    if (NULL == ParserOptions.Get())
        ParserOptions.Reset(new CParserOptions);

    ParserOptions->InitFromConfigObject(*Config.Get());

    return true;
}
开发者ID:Frankie-666,项目名称:tomita-parser,代码行数:87,代码来源:commonparm.cpp


注:本文中的Stroka::to_lower方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。