Skip to main content

C++-style IO with streams

Project description

This is a library that implements C++-style IO with streams in Python. It is not a wrapper around the actual C++ streams, but instead provides a higher-level interface that is more Pythonic.

For example

#include <iostream>
#include <fstream>
std::cout << "Hello, " << "World!" << std::endl;

std::ofstream ostrm("test.txt");
ostrm << "Hello, World!" << std::endl;

translates to

import cppstream

cppstream.cout << "Hello, " << "World!" << cppstream.endl

ostrm = cppstream.OutFileStream()

# or using the context manager
with cppstream.OutFileStream() as ofs:
    ofs.open("test.txt")
    ofs << "beans" << cppstream.endl

See the inheritance diagram:

streams.png

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cppstream-0.1.0.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

cppstream-0.1.0-py3-none-any.whl (6.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page