]> git.tdb.fi Git - builder.git/blobdiff - source/objcsourcefile.cpp
Add target and tools for compiling Objective-C sources
[builder.git] / source / objcsourcefile.cpp
diff --git a/source/objcsourcefile.cpp b/source/objcsourcefile.cpp
new file mode 100644 (file)
index 0000000..ed334fc
--- /dev/null
@@ -0,0 +1,23 @@
+#include <msp/strings/regex.h>
+#include "objcsourcefile.h"
+
+using namespace std;
+using namespace Msp;
+
+ObjCSourceFile::ObjCSourceFile(Builder &b, const FS::Path &p):
+       CSourceFile(b, p)
+{ }
+
+ObjCSourceFile::ObjCSourceFile(Builder &b, const Component &c, const FS::Path &p):
+       CSourceFile(b, c, p)
+{ }
+
+void ObjCSourceFile::parse_includes(IO::Base &in)
+{
+       static Regex r_include("^[ \t]*#(include|import)[ \t]+([\"<].*)[\">]");
+
+       string line;
+       while(in.getline(line))
+               if(RegMatch match = r_include.match(line))
+                       includes.push_back(match[2].str);
+}