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


C++ SC_StringArray::ForceMinStringLen方法代码示例

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


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

示例1: GetRunIDs

void  DC_ProfileSimResults::GetRunIDs(SC_StringArray&  runIDs) const
{
    runIDs.ForceMinStringLen(ProfileSimRunResults::runIDLen);
    runIDs.Alloc(Size());
    for (int i = 0; i < Size(); i++)
        runIDs += (*this)[i].runID;
};
开发者ID:jjayne,项目名称:nSIGHTS,代码行数:7,代码来源:DC_ProfileSimResults.cpp

示例2: GetFitIDs

void OptSimRunResults::GetFitIDs(SC_StringArray&  fitIDs) const
{
    fitIDs.ForceMinStringLen(OptFitDescription::fitIDLen);
    fitIDs.Alloc(fitDescriptions.Size());
    for (int i = 0; i < fitDescriptions.Size(); i++)
        fitIDs += fitDescriptions[i].fitID;
};
开发者ID:jjayne,项目名称:nSIGHTS,代码行数:7,代码来源:DC_OptSimResults.cpp

示例3: GetCaseIDs

void DC_ProfileSimResults::GetCaseIDs(SC_StringArray&  caseIDs) const
{
    static const int maxStrLen = ProfileSimRunResults::runIDLen + 1 + ProfileSimCaseResults::caseIDLen;
    caseIDs.ForceMinStringLen(maxStrLen);
    caseIDs.Alloc(GetnCases());
    char tempStr[maxStrLen];

    for (int i = 0; i < Size(); i++)
    {
        ProfileSimRunResults& currRun = (*this)[i];
        for (int j = 0; j < currRun.Size(); j++)
        {
            CopyString(tempStr, currRun.runID, maxStrLen);
            ConcatString(tempStr, "\t", maxStrLen);
            ConcatString(tempStr, currRun[j].caseID, maxStrLen);
            caseIDs += tempStr;
        }
    }
}
开发者ID:jjayne,项目名称:nSIGHTS,代码行数:19,代码来源:DC_ProfileSimResults.cpp

示例4: GetMenuStrings

// for use in menus
void DC_OptSimResults::GetMenuStrings(SC_StringArray&  ids,
                                      bool             includeFitComponents,
                                      bool             includeOKonly) const
{

    static const int maxStrLen = OptSimRunResults::runIDLen + 2 +
                                 CaseVarDescription::caseVarDescLen + 2 +
                                 OptFitDescription::fitIDLen  + 2 +
                                 OptFitComponentDescription::fitIDLen;

    ids.ForceMinStringLen(maxStrLen);
    if (includeFitComponents)
    {
        ids.Alloc(GetnFitComponents());
    }
    else
    {
        ids.Alloc(GetnFits());
    }

    char runStr[maxStrLen];
    char caseStr[maxStrLen];
    char fitStr[maxStrLen];
    char fitCompStr[maxStrLen];
    char okStr[maxStrLen];

    for (int i = 0; i < Size(); i++)
    {
        OptCaseResultsArray& currCases = (*this)[i].runResults;

        CopyString(runStr, (*this)[i].runID, maxStrLen);

        for (int j = 0; j < currCases.Size(); j++)
        {
            CopyString(caseStr, currCases[j].caseDesc, maxStrLen);

            int nfit = currCases[j].caseResults.Size();

            OptSingleFitArray&   currFits = currCases[j].caseResults;

            for (int k = 0; k < currFits.Size(); k++)
            {
                if (includeOKonly && (!currFits[k].fitCompletedOK))
                    continue;

                if (currFits[k].fitCompletedOK)
                {
                    CopyString(okStr, " \t OK", maxStrLen);
                }
                else
                {
                    CopyString(okStr, " \t Bad", maxStrLen);
                }

                CopyString(fitStr, runStr, maxStrLen);
                ConcatString(fitStr, "\t", maxStrLen);
                ConcatString(fitStr, caseStr, maxStrLen);
                ConcatString(fitStr, "\t", maxStrLen);
                ConcatString(fitStr, (*this)[i].fitDescriptions[k].fitID, maxStrLen);
                if (!includeOKonly)
                    ConcatString(fitStr, okStr, maxStrLen);

                if (includeFitComponents)
                {
                    OptFitComponentArray&   currFitComp = currFits[k].fitComponents;

                    for (int l = 0; l < currFitComp.Size(); l++)
                    {
                        CopyString(fitCompStr, fitStr, maxStrLen);
                        ConcatString(fitCompStr, "\t", maxStrLen);
                        ConcatString(fitCompStr, (*this)[i].fitDescriptions[k].fitComponentDescription[l].fitID, maxStrLen);
                        ids += fitCompStr;
                    }
                }
                else
                {
                    ids += fitStr;
                }
            }
        }
    }
}
开发者ID:jjayne,项目名称:nSIGHTS,代码行数:83,代码来源:DC_OptSimResults.cpp


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