Created
November 26, 2010 07:08
-
-
Save noqisofon/716373 to your computer and use it in GitHub Desktop.
INI 用 map ユーティリティーな感じ。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* マップコンテナ dictionary に keyname でアクセスした値が "yes" または "y" な | |
* ら真を返します。 | |
* @since 2010-09-03 | |
* @see map_about_yes_or_not_existsp | |
*/ | |
inline bool map_about_yesp( std::map<tstring, tstring>& dictionary, | |
const tstring& keyname | |
) | |
{ | |
tstring value = dictionary[keyname]; | |
return value == INI_VALUE_YES || value.find( INI_VALUE_SHORT_YES ); | |
} | |
/** | |
* マップコンテナ dictionary に keyname が無いとき、あるいは keyname でアクセス | |
* した値が "yes" または "y" なら真を返します。 | |
* @since 2010-09-03 | |
*/ | |
inline bool map_about_yes_or_not_existsp( std::map<tstring, tstring>& dictionary, | |
const tstring& keyname | |
) | |
{ | |
return dictionary.find( keyname ) == dictionary.end() | |
|| map_about_yesp( dictionary, keyname ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment