Added frombinary modifier.
This commit is contained in:
parent
96ff352d0f
commit
4d016197d2
@ -17,6 +17,27 @@ namespace jet {
|
||||
}
|
||||
|
||||
void Modifiers::processFromBinaryModifier(coreutils::MString &value, coreutils::MString &lastConverted) {
|
||||
value.reset();
|
||||
lastConverted = "";
|
||||
while(!value.eod()) {
|
||||
if(value.ifNext("\\r"))
|
||||
lastConverted.write(13);
|
||||
else if(value.ifNext("\\n"))
|
||||
lastConverted.write(10);
|
||||
else if(value.ifNext("\\0"))
|
||||
lastConverted.write(0);
|
||||
else if(value.ifNext("\\\\"))
|
||||
lastConverted.write("\\");
|
||||
else if(value.ifNext("\\."))
|
||||
lastConverted.write(".");
|
||||
else if(value.ifNext("\\\""))
|
||||
lastConverted.write("\"");
|
||||
else if(value.ifNext("\\\'"))
|
||||
lastConverted.write("'");
|
||||
else
|
||||
lastConverted.write(value.nextChar());
|
||||
}
|
||||
value.reset();
|
||||
}
|
||||
|
||||
void Modifiers::processToHexModifier(coreutils::MString &value, coreutils::MString &lastConverted) {
|
||||
|
@ -1,10 +1,10 @@
|
||||
#!../jet-2.0
|
||||
<jet>
|
||||
<set name="tester1" value="this is a test of the hex conversion." />
|
||||
<set name="tester1" value="this is a test \"of the hex\" conversion." />
|
||||
<set name="tester2" value="$[tester1;tohex]" />
|
||||
1) $[tester1;tobinary]
|
||||
2) $[tester1;tohex]
|
||||
3) $[tester2;fromhex]
|
||||
4) $[tester1]
|
||||
4) $[tester1;frombinary]
|
||||
5) $[tester2]
|
||||
</jet>
|
Loading…
x
Reference in New Issue
Block a user