]> git.tdb.fi Git - builder.git/blobdiff - source/component.cpp
Migrate from msppath to mspfs
[builder.git] / source / component.cpp
index e674b018aabf42c338585ef6072e76f70221f111..29bf9d10e692445bafe68c2e7095d46afa3fbadf 100644 (file)
@@ -6,7 +6,9 @@ Distributed under the LGPL
 */
 
 #include <msp/core/except.h>
-#include <msp/path/utils.h>
+#include <msp/fs/dir.h>
+#include <msp/fs/stat.h>
+#include <msp/fs/utils.h>
 #include <msp/strings/lexicalcast.h>
 #include "builder.h"
 #include "component.h"
@@ -85,8 +87,7 @@ void Component::create_targets() const
        list<Target *> inst_tgts;
        for(PathList::const_iterator i=files.begin(); i!=files.end(); ++i)
        {
-               string basename=(*i)[-1];
-               string ext=splitext(basename).ext;
+               string ext=FS::extpart(FS::basename(*i));
                if((ext==".cpp" || ext==".c") && build_exe)
                {
                        SourceFile *src=new SourceFile(builder, this, i->str());
@@ -151,8 +152,7 @@ PathList Component::collect_source_files() const
        PathList files;
        for(PathList::const_iterator i=sources.begin(); i!=sources.end(); ++i)
        {
-               struct stat st=stat(*i);
-               if(S_ISDIR(st.st_mode))
+               if(FS::is_dir(*i))
                {
                        list<string> sfiles=list_files(*i);
                        for(list<string>::iterator j=sfiles.begin(); j!=sfiles.end(); ++j)