summaryrefslogtreecommitdiff
path: root/src/user/lib/fwik/include/IO
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/lib/fwik/include/IO')
-rw-r--r--src/user/lib/fwik/include/IO/IOStream.h10
-rw-r--r--src/user/lib/fwik/include/IO/Node.h6
-rw-r--r--src/user/lib/fwik/include/IO/Term.h8
3 files changed, 16 insertions, 8 deletions
diff --git a/src/user/lib/fwik/include/IO/IOStream.h b/src/user/lib/fwik/include/IO/IOStream.h
index e381cf5..2e33268 100644
--- a/src/user/lib/fwik/include/IO/IOStream.h
+++ b/src/user/lib/fwik/include/IO/IOStream.h
@@ -12,14 +12,18 @@ class IOStream {
IOStream() : term(0) {}
IOStream(Term *t) : term(t) {}
- void print(char* str);
- void printf(char* fmt, ...);
+ void print(const char* str);
+ void printf(const char* fmt, ...);
String readln();
- IOStream &operator<<(char* s) {
+ IOStream &operator<<(const char* s) {
print(s);
return *this;
}
+ IOStream &operator<<(const String& s) {
+ print(s.c_str());
+ return *this;
+ }
IOStream &operator<<(int i) {
printf("%d", i);
return *this;
diff --git a/src/user/lib/fwik/include/IO/Node.h b/src/user/lib/fwik/include/IO/Node.h
index 6100fc9..ed8290f 100644
--- a/src/user/lib/fwik/include/IO/Node.h
+++ b/src/user/lib/fwik/include/IO/Node.h
@@ -6,6 +6,8 @@
#include <stdio.h>
#include <cpp.h>
+#include <String.h>
+
class Term;
class Node {
public:
@@ -14,7 +16,7 @@ class Node {
bool valid;
Node(FILE f);
- Node(char* filename, int mode);
+ Node(const char* filename, int mode);
virtual ~Node() {}
void close();
@@ -22,4 +24,6 @@ class Node {
virtual Term* as_term() { return 0; }
};
+String path_cat(const String &a, const String &b, bool trailing_slash = true);
+
#endif
diff --git a/src/user/lib/fwik/include/IO/Term.h b/src/user/lib/fwik/include/IO/Term.h
index 4fd9306..5b8aba3 100644
--- a/src/user/lib/fwik/include/IO/Term.h
+++ b/src/user/lib/fwik/include/IO/Term.h
@@ -16,13 +16,13 @@ class Term : public Node {
public:
Term(FILE f);
- Term(char* filename, int mode);
+ Term(const char* filename, int mode);
Term(const Node &n);
virtual ~Term();
- virtual void print(char *s);
- virtual void printf(char* fmt, ...);
- virtual void vprintf(char* fmt, va_list ap);
+ virtual void print(const char *s);
+ virtual void printf(const char* fmt, ...);
+ virtual void vprintf(const char* fmt, va_list ap);
virtual String readln();
String readline();