]> git.tdb.fi Git - builder.git/blobdiff - source/installedfile.cpp
Put constructor helper functions next to the constructors
[builder.git] / source / installedfile.cpp
index 4ee821fab1ab55bc74a5075a378f2b926e89b990..3ca490602055d18ef83cef933ea4605718e2c6c8 100644 (file)
@@ -20,6 +20,20 @@ InstalledFile::InstalledFile(Builder &b, const SourcePackage &p, FileTarget &s,
                builder.get_vfs().register_path(link, this);
 }
 
+FS::Path InstalledFile::generate_target_path(const FS::Path &prefix, const FileTarget &tgt, const string &loc)
+{
+       if(!tgt.is_installable() && loc.empty())
+               throw invalid_argument(tgt.get_name()+" is not installable");
+
+       string mid;
+       if(!loc.empty())
+               mid = loc;
+       else
+               mid = tgt.get_install_location();
+
+       return prefix/mid/FS::basename(tgt.get_path());
+}
+
 Target *InstalledFile::get_real_target()
 {
        return source.get_real_target();
@@ -34,17 +48,3 @@ void InstalledFile::check_rebuild()
        else if(source.needs_rebuild())
                mark_rebuild(source.get_name()+" needs rebuilding");
 }
-
-FS::Path InstalledFile::generate_target_path(const FS::Path &prefix, const FileTarget &tgt, const string &loc)
-{
-       if(!tgt.is_installable() && loc.empty())
-               throw invalid_argument(tgt.get_name()+" is not installable");
-
-       string mid;
-       if(!loc.empty())
-               mid = loc;
-       else
-               mid = tgt.get_install_location();
-
-       return prefix/mid/FS::basename(tgt.get_path());
-}