]> git.tdb.fi Git - builder.git/blobdiff - source/systemlibrary.cpp
Miscellaneous minor code cleanups
[builder.git] / source / systemlibrary.cpp
index 1df7b66787d8f85033dd98fe5e6f30f2c5c6535a..58eaea7087a095246aba7e2a7e496a2177158b56 100644 (file)
@@ -1,20 +1,26 @@
 /* $Id$
 
 This file is part of builder
-Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions
+Copyright © 2006-200 Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
-#include <msp/path/utils.h>
+#include <msp/fs/path.h>
+#include <msp/fs/utils.h>
 #include "systemlibrary.h"
 
 using namespace std;
 using namespace Msp;
 
-SystemLibrary::SystemLibrary(Builder &b, const string &n):
-       Target(b, 0, n)
+SystemLibrary::SystemLibrary(Builder &b, const FS::Path &p):
+       FileTarget(b, 0, p),
+       Library(b, 0, p, extract_libname(p))
+{ }
+
+string SystemLibrary::extract_libname(const FS::Path &p)
 {
-       libname=Path::splitext(Path::basename(n)).base;
-       if(!libname.compare(0, 3, "lib"))
-               libname.erase(0, 3);
+       string result=FS::basepart(FS::basename(p));
+       if(!result.compare(0, 3, "lib"))
+               result.erase(0, 3);
+       return result;
 }