From 56ca54a6f0e1c1dd806e9e93579c168b337e438c 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 745f47b..685dae6 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