Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions Source/ZenLib/InfoMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace ZenLib
/// @brief Helper for InfoMap
//***************************************************************************

class InfoMap : public std::multimap<Ztring, ZtringList>
class InfoMap : public std::multimap<Ztring, ZtringList>, protected ZSeparator
{
public :
//Constructors/Destructor
Expand All @@ -47,10 +47,6 @@ public :
/// 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
Expand Down
6 changes: 1 addition & 5 deletions Source/ZenLib/Translation.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace ZenLib
/// @brief Helper for translation
//***************************************************************************

class Translation : public std::map<Ztring, Ztring>
class Translation : public std::map<Ztring, Ztring>, protected ZSeparator
{
public :
//Constructors/Destructor
Expand Down Expand Up @@ -49,10 +49,6 @@ public :
/// 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
Expand Down
13 changes: 13 additions & 0 deletions Source/ZenLib/Ztring.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,19 @@ public :
bool Compare (const Ztring &ToCompare, const Ztring &Comparator=__T("=="), ztring_t Options=Ztring_Nothing) const;
};

class ZSeparator
{
public:
ZSeparator()
{
Max[0] = Max[1] = Error;
}
protected:
Ztring Separator[2];
Ztring Quote;
size_t Max[2];
};

} //NameSpace

#endif
2 changes: 2 additions & 0 deletions Source/ZenLib/ZtringList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ ZtringList::ZtringList ()
ZtringList::ZtringList(const ZtringList &Source)
: std::vector<ZenLib::Ztring, std::allocator<ZenLib::Ztring> > ()
{
Max[0] = Error;
Separator[0]=Source.Separator[0];
Quote=Source.Quote;

Expand Down Expand Up @@ -76,6 +77,7 @@ ZtringList::ZtringList (const Char *Source)
#ifdef _UNICODE
ZtringList::ZtringList (const char* S)
{
Max[0] = Error;
Write(Ztring(S));
}
#endif
Expand Down
6 changes: 1 addition & 5 deletions Source/ZenLib/ZtringListList.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace ZenLib
/// @brief Vector of vectors of strings manipulation (based on std::vector<std::vector<std::(w)string>>)
//***************************************************************************

class ZtringListList : public std::vector<ZtringList>
class ZtringListList : public std::vector<ZtringList>, protected ZSeparator
{
public :
//Constructors/Destructor
Expand Down Expand Up @@ -122,10 +122,6 @@ public :
/// 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
Expand Down
4 changes: 2 additions & 2 deletions Source/ZenLib/ZtringListListF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ bool ZtringListListF::CSV_Charger ()
//Separators
if (Separator[0]==__T("(Default)"))
Separator[0]=EOL;
Ztring SeparatorT=Separator[1];
const Ztring SeparatorT=Separator[1];
Separator[1]=__T(";");

//Writing
Expand Down Expand Up @@ -183,7 +183,7 @@ bool ZtringListListF::CFG_Charger ()
Z1.From_UTF8((char*)Buffer, 0, BytesCount);
List.Write(Z1);

Ztring SeparatorT=Separator[1];
const Ztring SeparatorT=Separator[1];
Separator[1]=__T(";");

Ztring Propriete, Valeur, Commentaire;
Expand Down