CFugue
Dictionary.h
Go to the documentation of this file.
1 /*
2  This is part of CFugue, the C++ Runtime for MIDI Score Programming
3  Copyright (C) 2009 Gopalakrishna Palem
4 
5  For links to further information, or to contact the author,
6  see <http://cfugue.sourceforge.net/>.
7 
8  $LastChangedDate: 2014-05-10 10:56:34 +0530 (Sat, 10 May 2014) $
9  $Rev: 203 $
10  $LastChangedBy: krishnapg $
11 */
12 
13 #ifndef __DICTIONARY_H__57D24F57_01B6_4fcd_B92E_7B7849C51407__
14 #define __DICTIONARY_H__57D24F57_01B6_4fcd_B92E_7B7849C51407__
15 
16 /** @file Dictionary.h
17  * \brief Declares Dictionary type used by the Parsers
18  */
19 
20 #include "Common/MString.h"
21 #include <map>
22 
23 namespace CFugue
24 {
25  /// <Summary>Implements the less operator for Maps with string case-insensitive comparisions </Summary>
26  template<class _Ty>
27  struct StringLess : public std::binary_function<_Ty, _Ty, bool>
28  {
29  inline bool operator()(const _Ty& _Left, const _Ty& _Right) const
30  {
31  return _tcsicmp(_Left, _Right) < 0 ? true : false; // check if (_Left < _Right);
32  }
33  };
34 
35  /// <Summary> Dictionary type maps a string key to a string value. The string
36  /// value can be an integer or double (in text form), or a string </Summary>
37  typedef std::map<MString, MString, StringLess<const TCHAR*> > DICTIONARY;
38 
39  /// <Summary> Accessor method to Populate standard macro definitions </Summary>
40  void PopulateStandardDefinitions(DICTIONARY& dictionaryObj);
41 
42 } // namespace CFugue
43 
44 #endif // __DICTIONARY_H__57D24F57_01B6_4fcd_B92E_7B7849C51407__
Implements the less operator for Maps with string case-insensitive comparisions
Definition: Dictionary.h:27
void PopulateStandardDefinitions(DICTIONARY &dictionaryObj)
Accessor method to Populate standard macro definitions
Definition: Dictionary.cpp:10
std::map< MString, MString, StringLess< const TCHAR * > > DICTIONARY
Definition: Dictionary.h:37

CFugue, the C++ Music Programming Library © Copyright 2009 Cenacle Research India Private Limited Gopalakrishna Palem