]> git.tdb.fi Git - builder.git/commitdiff
Derive BuildInfo::Loader from ObjectLoader
authorMikko Rasa <tdb@tdb.fi>
Sat, 21 Apr 2012 19:33:34 +0000 (22:33 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 8 Jul 2012 21:08:49 +0000 (00:08 +0300)
source/buildinfo.cpp
source/buildinfo.h

index 0ac20c91e0fce90f67caa5d7f07d0739215d094c..e9dcec0777e28f1201bc5a223f0853839b5d88f8 100644 (file)
@@ -67,7 +67,7 @@ void BuildInfo::unique()
 
 
 BuildInfo::Loader::Loader(BuildInfo &bi):
-       binfo(bi)
+       DataFile::ObjectLoader<BuildInfo>(bi)
 {
        add("cflag",   &Loader::cflag);
        add("incpath", &Loader::incpath);
@@ -80,35 +80,35 @@ BuildInfo::Loader::Loader(BuildInfo &bi):
 
 void BuildInfo::Loader::cflag(const std::string &s)
 {
-       binfo.cflags.push_back(s);
+       obj.cflags.push_back(s);
 }
 
 void BuildInfo::Loader::incpath(const std::string &s)
 {
-       binfo.incpath.push_back(s);
+       obj.incpath.push_back(s);
 }
 
 void BuildInfo::Loader::define(const std::string &s)
 {
-       binfo.defines.push_back(s);
+       obj.defines.push_back(s);
 }
 
 void BuildInfo::Loader::ldflag(const std::string &s)
 {
-       binfo.ldflags.push_back(s);
+       obj.ldflags.push_back(s);
 }
 
 void BuildInfo::Loader::libpath(const std::string &s)
 {
-       binfo.libpath.push_back(s);
+       obj.libpath.push_back(s);
 }
 
 void BuildInfo::Loader::library(const std::string &s)
 {
-       binfo.libs.push_back(s);
+       obj.libs.push_back(s);
 }
 
 void BuildInfo::Loader::warning(const std::string &s)
 {
-       binfo.warnings.push_back(s);
+       obj.warnings.push_back(s);
 }
index 11de3b0fe7b2a938b93d76c0bb253210851cb54e..0d7b64aeae4e8e82be35bfe9117cf26f7cd3c2e0 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <list>
 #include <string>
-#include <msp/datafile/loader.h>
+#include <msp/datafile/objectloader.h>
 #include "misc.h"
 
 /**
@@ -13,11 +13,8 @@ form.  Allows combining with other BuildInfos to support package dependencies.
 class BuildInfo
 {
 public:
-       class Loader: public Msp::DataFile::Loader
+       class Loader: public Msp::DataFile::ObjectLoader<BuildInfo>
        {
-       private:
-               BuildInfo &binfo;
-               
        public:
                Loader(BuildInfo &);
        private: