ZenLib

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

InfoMap.h
Go to the documentation of this file.
1 /* Copyright (c) MediaArea.net SARL. All Rights Reserved.
2 *
3 * Use of this source code is governed by a zlib-style license that can
4 * be found in the License.txt file in the root of the source tree.
5 */
6
7 //---------------------------------------------------------------------------
8 #ifndef ZenLib_InfoMapH
9 #define ZenLib_InfoMapH
10 //---------------------------------------------------------------------------
11
12 //---------------------------------------------------------------------------
13 #include "ZenLib/ZtringList.h"
14 #include <map>
15 //---------------------------------------------------------------------------
16
17 namespace ZenLib
18 {
19
20 //***************************************************************************
21 /// @brief Helper for InfoMap
22 //***************************************************************************
23
24 class InfoMap : public std::multimap<Ztring, ZtringList>
25 {
26 public :
27 //Constructors/Destructor
28 InfoMap ();
29 InfoMap (const Ztring &Source);
30 InfoMap (const Char *Source);
31 #ifdef _UNICODE
32 InfoMap (const char *Source); //convert a UTF-8 string into Unicode
33 #endif
34
35 //In/Out
36 const Ztring &Get (const Ztring &Value, size_t Pos) const;
37 const Ztring &Get (const Ztring &Value, size_t Pos, const Ztring &WithValue, size_t WithValue_Pos) const;
38 void Write (const Ztring &NewLanguage);
39
40 //Configuration
41 /// @brief Set the Separator character
42 void Separator_Set (size_type Level, const Ztring &NewSeparator);
43 /// @brief Set the Quote character
44 /// During Read() or Write() method, if Separator is in the sequence, we must quote it
45 void Quote_Set (const Ztring &NewQuote);
46 /// @brief Set the Maximum number of element to read
47 /// During Read() or Write() method, if there is more elements, merge them with the last element
48 void Max_Set (size_type Level, size_type Max);
49
50 protected :
51 Ztring Separator[2];
52 Ztring Quote;
53 size_type Max[2];
54 };
55
56 } //namespace
57 #endif
ZenLib::Char
char Char
Definition: Conf.h:215
ZenLib::InfoMap::Separator_Set
void Separator_Set(size_type Level, const Ztring &NewSeparator)
Set the Separator character.
ZenLib::InfoMap::Max
size_type Max[2]
Definition: InfoMap.h:53
ZenLib::InfoMap::Max_Set
void Max_Set(size_type Level, size_type Max)
Set the Maximum number of element to read During Read() or Write() method, if there is more elements...
ZenLib::InfoMap
Helper for InfoMap.
Definition: InfoMap.h:24
ZenLib
Definition: BitStream.h:23
ZtringList.h
ZenLib::InfoMap::Separator
Ztring Separator[2]
Definition: InfoMap.h:51
ZenLib::InfoMap::Quote
Ztring Quote
Definition: InfoMap.h:52
ZenLib::InfoMap::Get
const Ztring & Get(const Ztring &Value, size_t Pos) const
ZenLib::InfoMap::InfoMap
InfoMap()
ZenLib::Ztring
String manipulation (based on std::(w)string)
Definition: Ztring.h:49
ZenLib::InfoMap::Quote_Set
void Quote_Set(const Ztring &NewQuote)
Set the Quote character During Read() or Write() method, if Separator is in the sequence, we must quote it.
ZenLib::InfoMap::Write
void Write(const Ztring &NewLanguage)