]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/layout.cpp
Add Id tags and copyright notices to files
[r2c2.git] / source / libmarklin / layout.cpp
index 28d2eeb862ad85862e8cd45baab8291061d9261a..470d573e871179cd90bc9a7ddacb8a83591f231b 100644 (file)
@@ -1,3 +1,10 @@
+/* $Id$
+
+This file is part of the MSP Märklin suite
+Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa
+Distributed under the GPL
+*/
+
 #include <fstream>
 #include <msp/core/refptr.h>
 #include <msp/datafile/parser.h>
@@ -14,6 +21,12 @@ Layout::Layout(Catalogue &c):
        catalogue(c)
 { }
 
+Layout::~Layout()
+{
+       for(set<Track *>::iterator i=tracks.begin(); i!=tracks.end(); ++i)
+               delete *i;
+}
+
 void Layout::add_track(Track &t)
 {
        if(tracks.insert(&t).second)
@@ -63,7 +76,7 @@ int Layout::save(const string &fn)
 
        filename=fn;
 
-       if(base.size())
+       if(!base.empty())
                out<<"base \""<<base<<"\";\n";
        for(set<Track *>::iterator i=tracks.begin(); i!=tracks.end(); ++i)
        {
@@ -90,15 +103,6 @@ int Layout::save(const string &fn)
        return 0;
 }
 
-Layout::~Layout()
-{
-       for(set<Track *>::iterator i=tracks.begin(); i!=tracks.end(); ++i)
-               delete *i;
-}
-
-/*******************
-** Layout::Loader
-*/
 
 Layout::Loader::Loader(Layout &l):
        layout(l)