我正在尝试用C ++创建自定义的ofstream类,允许这样使用:
RSAKeys keys = LoadRSAKeys("public.pub", "private.priv");
EncryptedOFStream encofstream("outputfile.txt", keys);
encofstream << "Some text";
// Now in outputfile.txt should be encrypted text
我有正确继承ofstream类的问题。经过太多的PHP后,我的大脑被破坏了。你能建议一些基本的骨架吗?
答案 0 :(得分:1)
查看具有类似目标的项目,例如zipstream
,它实现压缩成ZIP和BZ2档案的I / O流。该库使用zlib
和bzip2
库,因此它应该只包含流和流缓冲区实现代码。