mirror of
https://github.com/jezhiggins/arabica
synced 2025-01-14 08:01:49 +01:00
wide string fixes
This commit is contained in:
parent
e2d28dc77c
commit
f65e534f9d
1 changed files with 34 additions and 20 deletions
|
@ -17,29 +17,43 @@ int main(int argc, char* argv[])
|
|||
return 0;
|
||||
} // if(argc < 2)
|
||||
|
||||
/*
|
||||
{ // narrow
|
||||
SAX::FeatureNames<std::string> fNames;
|
||||
SAX::XMLReader<std::string> parser;
|
||||
SAX::Writer writer(std::cout);
|
||||
writer.setParent(parser);
|
||||
|
||||
SAX::FeatureNames<std::string> fNames;
|
||||
SAX::XMLReader<std::string> parser;
|
||||
SAX::Writer writer(std::cout);
|
||||
writer.setParent(parser);
|
||||
|
||||
for(int i = 1; i < argc; ++i)
|
||||
{
|
||||
std::string file(argv[i]);
|
||||
SAX::InputSource is;
|
||||
is.setSystemId(file);
|
||||
|
||||
if(file != "-")
|
||||
writer.parse(is);
|
||||
else
|
||||
for(int i = 1; i < argc; ++i)
|
||||
{
|
||||
is.setSystemId("stdin");
|
||||
is.setByteStream(std::cin);
|
||||
std::string file(argv[i]);
|
||||
SAX::InputSource is;
|
||||
is.setSystemId(file);
|
||||
|
||||
writer.parse(is);
|
||||
} // if(file != "-")
|
||||
} // for ...
|
||||
if(file != "-")
|
||||
writer.parse(is);
|
||||
else
|
||||
{
|
||||
is.setSystemId("stdin");
|
||||
is.setByteStream(std::cin);
|
||||
|
||||
writer.parse(is);
|
||||
} // if(file != "-")
|
||||
} // for ...
|
||||
}
|
||||
*/
|
||||
{ // wide
|
||||
SAX::FeatureNames<std::wstring> fNames;
|
||||
SAX::XMLReader<std::wstring> parser;
|
||||
SAX::wWriter writer(std::wcout);
|
||||
writer.setParent(parser);
|
||||
|
||||
SAX::wInputSource is;
|
||||
is.setSystemId(L"stdin");
|
||||
is.setByteStream(std::cin);
|
||||
|
||||
writer.parse(is);
|
||||
}
|
||||
|
||||
return 0;
|
||||
} // main
|
||||
|
|
Loading…
Reference in a new issue