mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-06-20 17:17:13 +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:
54
vendor/POCO/Foundation/samples/BinaryReaderWriter/src/BinaryReaderWriter.cpp
vendored
Normal file
54
vendor/POCO/Foundation/samples/BinaryReaderWriter/src/BinaryReaderWriter.cpp
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
//
|
||||
// BinaryReaderWriter.cpp
|
||||
//
|
||||
// This sample demonstrates the BinaryWriter and BinaryReader classes.
|
||||
//
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#include "Poco/BinaryWriter.h"
|
||||
#include "Poco/BinaryReader.h"
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
using Poco::BinaryWriter;
|
||||
using Poco::BinaryReader;
|
||||
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
std::stringstream str;
|
||||
|
||||
BinaryWriter writer(str);
|
||||
writer << true
|
||||
<< 'x'
|
||||
<< 42
|
||||
<< 3.14159265
|
||||
<< "foo bar";
|
||||
|
||||
bool b;
|
||||
char c;
|
||||
int i;
|
||||
double d;
|
||||
std::string s;
|
||||
|
||||
BinaryReader reader(str);
|
||||
reader >> b
|
||||
>> c
|
||||
>> i
|
||||
>> d
|
||||
>> s;
|
||||
|
||||
std::cout << b << std::endl
|
||||
<< c << std::endl
|
||||
<< i << std::endl
|
||||
<< d << std::endl
|
||||
<< s << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user