ZenLib
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
17namespace ZenLib
18{
19
20//***************************************************************************
21/// @brief Helper for InfoMap
22//***************************************************************************
23
24class InfoMap : public std::multimap<Ztring, ZtringList>
25{
26public :
27 //Constructors/Destructor
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
50protected :
53 size_type Max[2];
54};
55
56} //namespace
57#endif
Helper for InfoMap.
Definition: InfoMap.h:25
void Quote_Set(const Ztring &NewQuote)
Set the Quote character During Read() or Write() method, if Separator is in the sequence,...
const Ztring & Get(const Ztring &Value, size_t Pos, const Ztring &WithValue, size_t WithValue_Pos) const
InfoMap(const Ztring &Source)
size_type Max[2]
Definition: InfoMap.h:53
void Write(const Ztring &NewLanguage)
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,...
void Separator_Set(size_type Level, const Ztring &NewSeparator)
Set the Separator character.
const Ztring & Get(const Ztring &Value, size_t Pos) const
Ztring Quote
Definition: InfoMap.h:52
InfoMap(const Char *Source)
Ztring Separator[2]
Definition: InfoMap.h:51
String manipulation (based on std::(w)string)
Definition: Ztring.h:50
Definition: BitStream.h:24
char Char
Definition: Conf.h:225