1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-08-18 05:47:10 +02:00

Major plugin refactor and cleanup.

Switched to POCO library for unified platform/library interface.
Deprecated the external module API. It was creating more problems than solving.
Removed most built-in libraries in favor of system libraries for easier maintenance.
Cleaned and secured code with help from static analyzers.
This commit is contained in:
Sandu Liviu Catalin
2021-01-30 08:51:39 +02:00
parent e0e34b4030
commit 4a6bfc086c
6219 changed files with 1209835 additions and 454916 deletions

View File

@@ -0,0 +1,56 @@
//
// PrettyPrint.cpp
//
// This sample demonstrates the SAXParser, WhitespaceFilter,
// InputSource and XMLWriter classes.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/SAX/SAXParser.h"
#include "Poco/SAX/WhitespaceFilter.h"
#include "Poco/SAX/InputSource.h"
#include "Poco/XML/XMLWriter.h"
#include "Poco/Exception.h"
#include <iostream>
using Poco::XML::SAXParser;
using Poco::XML::XMLReader;
using Poco::XML::WhitespaceFilter;
using Poco::XML::InputSource;
using Poco::XML::XMLWriter;
using Poco::Exception;
int main(int argc, char** argv)
{
// read XML from standard input and pretty-print it to standard output
SAXParser parser;
WhitespaceFilter filter(&parser);
XMLWriter writer(std::cout, XMLWriter::CANONICAL | XMLWriter::PRETTY_PRINT);
writer.setNewLine(XMLWriter::NEWLINE_LF);
filter.setContentHandler(&writer);
filter.setDTDHandler(&writer);
filter.setProperty(XMLReader::PROPERTY_LEXICAL_HANDLER, static_cast<Poco::XML::LexicalHandler*>(&writer));
try
{
InputSource source(std::cin);
filter.parse(&source);
}
catch (Exception& exc)
{
std::cerr << exc.displayText() << std::endl;
return 1;
}
return 0;
}