InfoMap.h
Go to the documentation of this file.
/* Copyright (c) MediaArea.net SARL. All Rights Reserved.
*
* Use of this source code is governed by a zlib-style license that can
* be found in the License.txt file in the root of the source tree.
*/
//---------------------------------------------------------------------------
#ifndef ZenLib_InfoMapH
#define ZenLib_InfoMapH
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#include "ZenLib/ZtringList.h"
#include <map>
//---------------------------------------------------------------------------
namespace ZenLib
{
//***************************************************************************
/// @brief Helper for InfoMap
//***************************************************************************
class InfoMap : public std::multimap<Ztring, ZtringList>
{
public :
//Constructors/Destructor
InfoMap ();
InfoMap (const Ztring &Source);
InfoMap (const Char *Source);
#ifdef _UNICODE
InfoMap (const char *Source); //convert a UTF-8 string into Unicode
#endif
//In/Out
const Ztring &Get (const Ztring &Value, size_t Pos) const;
const Ztring &Get (const Ztring &Value, size_t Pos, const Ztring &WithValue, size_t WithValue_Pos) const;
void Write (const Ztring &NewLanguage);
//Configuration
/// @brief Set the Separator character
void Separator_Set (size_type Level, const Ztring &NewSeparator);
/// @brief Set the Quote character
/// During Read() or Write() method, if Separator is in the sequence, we must quote it
void Quote_Set (const Ztring &NewQuote);
/// @brief Set the Maximum number of element to read
/// During Read() or Write() method, if there is more elements, merge them with the last element
void Max_Set (size_type Level, size_type Max);
protected :
Ztring Separator[2];
Ztring Quote;
size_type Max[2];
};
} //namespace
#endif
ZtringList.h
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,...
ZenLib::InfoMap::Get
const Ztring & Get(const Ztring &Value, size_t Pos, const Ztring &WithValue, size_t WithValue_Pos) const
ZenLib::InfoMap::InfoMap
InfoMap(const Ztring &Source)
ZenLib::InfoMap::Max
size_type Max[2]
Definition InfoMap.h:53
ZenLib::InfoMap::Write
void Write(const Ztring &NewLanguage)
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::InfoMap
InfoMap()
ZenLib::InfoMap::Separator_Set
void Separator_Set(size_type Level, const Ztring &NewSeparator)
Set the Separator character.
ZenLib::InfoMap::Get
const Ztring & Get(const Ztring &Value, size_t Pos) const
ZenLib::InfoMap::Quote
Ztring Quote
Definition InfoMap.h:52
ZenLib::InfoMap::InfoMap
InfoMap(const Char *Source)
ZenLib::InfoMap::Separator
Ztring Separator[2]
Definition InfoMap.h:51
ZenLib::Ztring
String manipulation (based on std::(w)string).
Definition Ztring.h:50
ZenLib
Definition BitStream.h:24
ZenLib::Char
char Char
Definition Conf.h:225