1 /* 2 * this file is part of the oxygen gtk engine 3 * Copyright (c) 2010 Hugo Pereira Da Costa <hugo.pereira@free.fr> 4 * Copyright (c) 2012 Ruslan Kabatsayev <b7.10110111@gmail.com> 5 * 6 * inspired notably from kdelibs/kdeui/color/kcolorutils.h 7 * Copyright (C) 2007 Matthew Woehlke <mw_triad@users.sourceforge.net> 8 * Copyright (C) 2007 Thomas Zander <zander@kde.org> 9 * Copyright (C) 2007 Zack Rusin <zack@kde.org> 10 * 11 * This library is free software; you can redistribute it and/or 12 * modify it under the terms of the GNU Lesser General Public 13 * License as published by the Free Software Foundation; either 14 * version 2 of the License, or( at your option ) any later version. 15 * 16 * This library is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 * Lesser General Public License for more details. 20 * 21 * You should have received a copy of the GNU Lesser General Public 22 * License along with this library; if not, write to the Free 23 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, 24 * MA 02110-1301, USA. 25 */ 26 27 #include "oxygenoption.h" 28 29 namespace Oxygen 30 { 31 //_______________________________________________________________________ toVariant(std::string defaultValue) const32 template<> std::string Option::toVariant( std::string defaultValue ) const 33 { 34 35 std::string out; 36 std::istringstream stream( _value ); 37 return ( std::getline(stream, out) ) ? out:defaultValue; 38 } 39 40 } 41