0

したがって、.cfg ファイルから値を読み取るとされる関数がここにあり、ファイルは正しく設定されていますが、ファイルに加えた変更によって値が反映されていません。だから私はデバッグします。問題は、値が検索される繰り返しをスキップすることです! したがって、デフォルト値を受け入れているだけなのか、それとも何かが間違っているのかわかりません。

bool ConfigReader::GetBool(const std::string theSection,
                           const std::string theName, const bool theDefault) const
{
    bool anResult = theDefault; // this is the line where I have a breakpoint set

    // Check if theSection really exists
    std::map<const std::string, typeNameValue*>::const_iterator iter;
    iter = mSections.find(theSection);
    if(iter != mSections.end())
    {
        // Try to obtain the name, value pair
        typeNameValue* anMap = iter->second;
        if(NULL != anMap)
        {
            typeNameValueIter iterNameValue;
            iterNameValue = anMap->find(theName);
            if(iterNameValue != anMap->end())
            {
                anResult = ParseBool(iterNameValue->second, theDefault);
            }
        }
    }

    // Return the result found or theDefault assigned above
    return anResult; // this is the line where it skips to (not much help)
}

スキップの間の行にブレークポイントを配置しようとしましたが、とにかくスキップします。

私の問題がこれに関連しているかどうかはわかりませんが、似ているように聞こえます: Xcode 4.5 で c++ をデバッグするときに、コードのステップ実行が STL コードで停止する

ここで何が起こっているのか、またはそれを修正/回避するために何ができるか知っている人はいますか? また、間違って投稿した場合は、あらかじめお詫び申し上げます。

GetBool 関数を呼び出します。

mProperties.Add<bool>("bMusicOn",
                      settingsConfig.GetAsset().GetBool("music", "on", true));
4

0 に答える 0