Added license header to primitives.cpp

Fri, 21 Jun 2013 17:29:29 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Fri, 21 Jun 2013 17:29:29 +0300
changeset 297
2cbd8ac8293b
parent 296
d544de09c93b
child 298
f945fc8dae9e

Added license header to primitives.cpp

src/main.cpp file | annotate | diff | comparison | revisions
src/primitives.cpp file | annotate | diff | comparison | revisions
src/types.h file | annotate | diff | comparison | revisions
--- 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
+}
--- 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 <http://www.gnu.org/licenses/>.
+ */
+
 #include <QDir>
 #include <QThread>
 #include <QRegExp>
--- 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<class T> StringFormatArg (const vector<T>& 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

mercurial