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


C++ StringBuilder::AppendCStr方法代码示例

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


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

示例1:

ECode CX509CRLSelector::ToString(
    /* [out] */ String *str)
{
    StringBuilder result;
    result.AppendCStr("X509CRLSelector:\n[");
    if (mIssuerNames) {
        result.AppendCStr("\n  IssuerNames:\n  [");
        Int32 size;
        mIssuerNames->GetSize(&size);
        for (Int32 i = 0; i < size; i++) {
            result.AppendCStr("\n    ");
            AutoPtr<IInterface> elem;
            mIssuerNames->Get(i, (IInterface**)&elem);
            String name;
            ICharSequence::Probe(elem)->ToString(&name);
            result.AppendString(name);
        }
        result.AppendCStr("\n  ]");
    }
    if (mMinCRL != NULL) {
        result.AppendCStr("\n  minCRL: ");
        result.AppendObject(mMinCRL.Get());
    }
    if (mMaxCRL != NULL) {
        result.AppendCStr("\n  mMaxCRL: ");
        result.AppendObject(mMaxCRL.Get());
    }
    if (mDateAndTime != -1) {
        result.AppendCStr("\n  dateAndTime: ");
        AutoPtr<IDate> dt;
        CDate::New(mDateAndTime, (IDate**)&dt);
        result.AppendObject(dt.Get());
    }
    if (mCertificateChecking != NULL) {
        result.AppendCStr("\n  certificateChecking: ");
        result.AppendObject(mCertificateChecking.Get());
    }
    result.AppendCStr("\n]");
    return result.ToString(str);
}
开发者ID:imace,项目名称:ElastosRDK5_0,代码行数:40,代码来源:CX509CRLSelector.cpp

示例2: ShowUsage

/**
 * Print how to use this command.
 */
void Monkey::ShowUsage()
{
    StringBuilder usage;
    usage.AppendCStr("usage: monkey [-p ALLOWED_PACKAGE [-p ALLOWED_PACKAGE] ...]\n");
    usage.AppendCStr("              [-c MAIN_CATEGORY [-c MAIN_CATEGORY] ...]\n");
    usage.AppendCStr("              [--ignore-crashes] [--ignore-timeouts]\n");
    usage.AppendCStr("              [--ignore-security-exceptions]\n");
    usage.AppendCStr("              [--monitor-native-crashes] [--ignore-native-crashes]\n");
    usage.AppendCStr("              [--kill-process-after-error] [--hprof]\n");
    usage.AppendCStr("              [--pct-touch PERCENT] [--pct-motion PERCENT]\n");
    usage.AppendCStr("              [--pct-trackball PERCENT] [--pct-syskeys PERCENT]\n");
    usage.AppendCStr("              [--pct-nav PERCENT] [--pct-majornav PERCENT]\n");
    usage.AppendCStr("              [--pct-appswitch PERCENT] [--pct-flip PERCENT]\n");
    usage.AppendCStr("              [--pct-anyevent PERCENT] [--pct-pinchzoom PERCENT]\n");
    usage.AppendCStr("              [--pkg-blacklist-file PACKAGE_BLACKLIST_FILE]\n");
    usage.AppendCStr("              [--pkg-whitelist-file PACKAGE_WHITELIST_FILE]\n");
    usage.AppendCStr("              [--wait-dbg] [--dbg-no-events]\n");
    usage.AppendCStr("              [--setup scriptfile] [-f scriptfile [-f scriptfile] ...]\n");
    usage.AppendCStr("              [--port port]\n");
    usage.AppendCStr("              [-s SEED] [-v [-v] ...]\n");
    usage.AppendCStr("              [--throttle MILLISEC] [--randomize-throttle]\n");
    usage.AppendCStr("              [--profile-wait MILLISEC]\n");
    usage.AppendCStr("              [--device-sleep-time MILLISEC]\n");
    usage.AppendCStr("              [--randomize-script]\n");
    usage.AppendCStr("              [--script-log]\n");
    usage.AppendCStr("              [--bugreport]\n");
    usage.AppendCStr("              [--periodic-bugreport]\n");
    usage.AppendCStr("              COUNT\n");
    PFL_EX(usage.ToString().string());
}
开发者ID:TheTypoMaster,项目名称:ElastosRDK5_0,代码行数:33,代码来源:Monkey.cpp


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