From 49ad95dd5fd6b6472c7048b155038721a2ea06ad Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Thu, 16 Jun 2011 21:31:28 +0200 Subject: Vector resources can now specify which char to use as delimiters when saving/loading to/from string representation. This is needed for the next commit. --- src/FbTk/ResTraits.hh | 4 ++-- src/Window.cc | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/FbTk/ResTraits.hh b/src/FbTk/ResTraits.hh index 3ee4464..3284801 100644 --- a/src/FbTk/ResTraits.hh +++ b/src/FbTk/ResTraits.hh @@ -160,7 +160,7 @@ struct EnumTraits { } }; -template +template struct VectorTraits { typedef std::vector Type; static std::string toString(const Type &x) { @@ -186,7 +186,7 @@ struct VectorTraits { static Type fromString(const std::string &x) { std::vector val; - StringUtil::stringtok(val, x); + StringUtil::stringtok(val, x, delim); Type retval; for(size_t i = 0; i < val.size(); i++) { diff --git a/src/Window.cc b/src/Window.cc index ad68e6d..b2f532a 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -251,9 +251,10 @@ private: int m_mode; }; +extern const char win_buttons_delim[] = " \t\n"; typedef FbTk::Resource< vector, - FbTk::VectorTraits > + FbTk::VectorTraits, win_buttons_delim> > WinButtonsResource; } -- cgit v0.11.2