aboutsummaryrefslogtreecommitdiff
path: root/src/minimacro.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/minimacro.h')
-rw-r--r--src/minimacro.h42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/minimacro.h b/src/minimacro.h
index 2a1fe23..0483190 100644
--- a/src/minimacro.h
+++ b/src/minimacro.h
@@ -9,11 +9,11 @@
9#define BU_MINI_MACRO_H 9#define BU_MINI_MACRO_H
10 10
11#include "bu/hash.h" 11#include "bu/hash.h"
12#include "bu/fstring.h" 12#include "bu/string.h"
13 13
14namespace Bu 14namespace Bu
15{ 15{
16 typedef Bu::Hash<Bu::FString, Bu::FString> StrHash; 16 typedef Bu::Hash<Bu::String, Bu::String> StrHash;
17 /** 17 /**
18 * A processor for Libbu++ brand Mini Macros. These are really simple, but 18 * A processor for Libbu++ brand Mini Macros. These are really simple, but
19 * still fairly flexible. It's mainly text replacement, but with a few 19 * still fairly flexible. It's mainly text replacement, but with a few
@@ -67,34 +67,34 @@ namespace Bu
67 MiniMacro( const StrHash &sVarSrc ); 67 MiniMacro( const StrHash &sVarSrc );
68 virtual ~MiniMacro(); 68 virtual ~MiniMacro();
69 69
70 Bu::FString parse( const Bu::FString &sIn ); 70 Bu::String parse( const Bu::String &sIn );
71 void addVar( const Bu::FString &sName, const Bu::FString &sValue ); 71 void addVar( const Bu::String &sName, const Bu::String &sValue );
72 bool hasVar( const Bu::FString &sName ); 72 bool hasVar( const Bu::String &sName );
73 const Bu::FString &getVar( const Bu::FString &sName ); 73 const Bu::String &getVar( const Bu::String &sName );
74 const StrHash &getVars(); 74 const StrHash &getVars();
75 int getPosition(); 75 int getPosition();
76 76
77 private: 77 private:
78 const char *sCur; 78 const char *sCur;
79 Bu::FString parseRepl(); 79 Bu::String parseRepl();
80 Bu::FString parseCond(); 80 Bu::String parseCond();
81 Bu::FString parseCmd(); 81 Bu::String parseCmd();
82 Bu::FString callFunc( 82 Bu::String callFunc(
83 const Bu::FString &sIn, const Bu::FString &sFunc ); 83 const Bu::String &sIn, const Bu::String &sFunc );
84 84
85 StrHash hVars; 85 StrHash hVars;
86 bool bContinue; 86 bool bContinue;
87 int iLastPos; 87 int iLastPos;
88 88
89 public: 89 public:
90 typedef Bu::List<Bu::FString> StrList; 90 typedef Bu::List<Bu::String> StrList;
91 class Func 91 class Func
92 { 92 {
93 public: 93 public:
94 Func(){} 94 Func(){}
95 virtual ~Func(){} 95 virtual ~Func(){}
96 virtual Bu::FString call( 96 virtual Bu::String call(
97 const Bu::FString &sIn, StrList &lsParam )=0; 97 const Bu::String &sIn, StrList &lsParam )=0;
98 }; 98 };
99 99
100 class FuncToUpper : public Func 100 class FuncToUpper : public Func
@@ -102,10 +102,10 @@ namespace Bu
102 public: 102 public:
103 FuncToUpper(){} 103 FuncToUpper(){}
104 virtual ~FuncToUpper(){} 104 virtual ~FuncToUpper(){}
105 virtual Bu::FString call( 105 virtual Bu::String call(
106 const Bu::FString &sIn, StrList & ) 106 const Bu::String &sIn, StrList & )
107 { 107 {
108 Bu::FString sOut( sIn ); 108 Bu::String sOut( sIn );
109 sOut.toUpper(); 109 sOut.toUpper();
110 return sOut; 110 return sOut;
111 } 111 }
@@ -116,17 +116,17 @@ namespace Bu
116 public: 116 public:
117 FuncToLower(){} 117 FuncToLower(){}
118 virtual ~FuncToLower(){} 118 virtual ~FuncToLower(){}
119 virtual Bu::FString call( 119 virtual Bu::String call(
120 const Bu::FString &sIn, StrList & ) 120 const Bu::String &sIn, StrList & )
121 { 121 {
122 Bu::FString sOut( sIn ); 122 Bu::String sOut( sIn );
123 sOut.toLower(); 123 sOut.toLower();
124 return sOut; 124 return sOut;
125 } 125 }
126 }; 126 };
127 127
128 private: 128 private:
129 typedef Bu::Hash<Bu::FString,class Func *> FuncHash; 129 typedef Bu::Hash<Bu::String,class Func *> FuncHash;
130 FuncHash hFuncs; 130 FuncHash hFuncs;
131 }; 131 };
132}; 132};