aboutsummaryrefslogtreecommitdiff
path: root/src/minimacro.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-01-20 18:09:04 +0000
committerMike Buland <eichlan@xagasoft.com>2011-01-20 18:09:04 +0000
commit393f1b414746a7f1977971dd7659dd2b47092b11 (patch)
tree81d0ca1ee70ab86a7d79c1991abe5c387b655fb2 /src/minimacro.h
parentc259f95bd0e58b247940a339bb9b4b401b4e9438 (diff)
parent7e25a863325dc3e9762397e700030969e093b087 (diff)
downloadlibbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.gz
libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.bz2
libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.xz
libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.zip
Wow! Merged the branch, streams are updated, and there's no more FString, run
the fixstrings.sh script in the support directory to (hopefully) automatically update your projects.
Diffstat (limited to '')
-rw-r--r--src/minimacro.h44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/minimacro.h b/src/minimacro.h
index 2a1fe23..582e1b0 100644
--- a/src/minimacro.h
+++ b/src/minimacro.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2007-2010 Xagasoft, All rights reserved. 2 * Copyright (C) 2007-2011 Xagasoft, All rights reserved.
3 * 3 *
4 * This file is part of the libbu++ library and is released under the 4 * This file is part of the libbu++ library and is released under the
5 * terms of the license contained in the file LICENSE. 5 * terms of the license contained in the file LICENSE.
@@ -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};