⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pinmem.cxx

📁 PTypes是一个扩充了多线程和网络功能的STL库
💻 CXX
字号:
/* * *  C++ Portable Types Library (PTypes) *  Version 2.0.2  Released 17-May-2004 * *  Copyright (C) 2001-2004 Hovik Melikyan * *  http://www.melikyan.com/ptypes/ * */#include "pstreams.h"PTYPES_BEGINinmemory::inmemory(const string& imem)    : instm(length(imem)), mem(imem) {}inmemory::~inmemory() {    close();}int inmemory::classid(){    return CLASS2_INMEMORY;}void inmemory::bufalloc() {    bufdata = pchar(pconst(mem));    abspos = bufsize = bufend = length(mem);}void inmemory::buffree() {    bufclear();    bufdata = nil;}void inmemory::bufvalidate() {    eof = bufpos >= bufend;}void inmemory::doopen() {}void inmemory::doclose() {}int inmemory::doseek(int, ioseekmode){    return -1;}int inmemory::dorawread(char*, int) {    return 0;}string inmemory::get_streamname() {    return "mem";}int inmemory::seek(int newpos, ioseekmode mode){    if (mode == IO_END)    {        newpos += bufsize;        mode = IO_BEGIN;    }    return instm::seek(newpos, mode);}void inmemory::set_strdata(const string& data){    close();    mem = data;}PTYPES_END

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -