# HG changeset patch # User Santeri Piippo # Date 1371824969 -10800 # Node ID 2cbd8ac8293b6fe6f2d0a8849666f5940f9ce7e6 # Parent d544de09c93bd7e259661ae76482174d6b77d703 Added license header to primitives.cpp diff -r d544de09c93b -r 2cbd8ac8293b src/main.cpp --- a/src/main.cpp Sun Jun 16 01:39:19 2013 +0300 +++ b/src/main.cpp Fri Jun 21 17:29:29 2013 +0300 @@ -185,4 +185,4 @@ bombBox (errmsg); abort (); -} \ No newline at end of file +} diff -r d544de09c93b -r 2cbd8ac8293b src/primitives.cpp --- a/src/primitives.cpp Sun Jun 16 01:39:19 2013 +0300 +++ b/src/primitives.cpp Fri Jun 21 17:29:29 2013 +0300 @@ -1,3 +1,21 @@ +/* + * LDForge: LDraw parts authoring CAD + * Copyright (C) 2013 Santeri Piippo + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include #include diff -r d544de09c93b -r 2cbd8ac8293b src/types.h --- a/src/types.h Sun Jun 16 01:39:19 2013 +0300 +++ b/src/types.h Fri Jun 21 17:29:29 2013 +0300 @@ -377,6 +377,24 @@ StringFormatArg (const intconfig& v); StringFormatArg (const floatconfig& v); + template StringFormatArg (const vector& v) { + m_val = "{ "; + + uint i = 0; + for (const T& it : v) { + if (i++) + m_val += ", "; + + StringFormatArg arg (it); + m_val += arg.value (); + } + + if (i) + m_val += " "; + + m_val += "}"; + } + str value () const { return m_val; } private: str m_val; @@ -450,4 +468,4 @@ // Null-file, equivalent to a null FILE* extern const File nullfile; -#endif // TYPES_H \ No newline at end of file +#endif // TYPES_H