added dump tag.
This commit is contained in:
1 parent
a9ce087939
commit
1c7edf3118
5 files changed
+60
-5
No files matched your search
+33
@@ -0,0 +1,33 @@
|
||||
#include "__dump.h"
|
||||
#include "Exception.h"
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
namespace jet {
|
||||
|
||||
__dump::__dump(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
||||
if(!variableDefined("file"))
|
||||
throw coreutils::Exception("file must be sppecified for dump tag.");
|
||||
|
||||
std::ofstream outFile(variables["file"].str());
|
||||
|
||||
outFile << "*** CGI VARIABLES ***" << std::endl;
|
||||
|
||||
for (auto i = global.cgiVariables.begin(); i != global.cgiVariables.end(); i++)
|
||||
outFile << i->first << "=[" << i->second << "]" << std::endl;
|
||||
|
||||
outFile << "*** GLOBAL VARIABLES ***" << std::endl;
|
||||
|
||||
for (auto i = global.variables.begin(); i != global.variables.end(); i++)
|
||||
outFile << i->first << "=[" << i->second << "]" << std::endl;
|
||||
|
||||
outFile << "*** LOCAL VARIABLES ***" << std::endl;
|
||||
|
||||
for (auto i = parent->variables.begin(); i != parent->variables.end(); i++)
|
||||
outFile << i->first << "=[" << i->second << "]" << std::endl;
|
||||
|
||||
outFile.close();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user