#ifndef RAPIDJSON_FILESTREAM_H_#define RAPIDJSON_FILESTREAM_H_#include<cstdio>namespacerapidjson{//! Wrapper of C file stream for input or output./*!This simple wrapper does not check the validity of the stream.\implements Stream*/classFileStream{public:typedefcharCh;//!< Character type. Only support char.FileStream(FILE*fp):fp_(fp),count_(0){Read();}charPeek()const{returncurrent_;}charTake(){charc=current_;Read();returnc;}size_tTell()const{returncount_;}voidPut(charc){fputc(c,fp_);}// Not implementedchar*PutBegin(){return0;}size_tPutEnd(char*){return0;}private:voidRead(){RAPIDJSON_ASSERT(fp_!=0);intc=fgetc(fp_);if(c!=EOF){current_=(char)c;count_++;}elsecurrent_='\0';}FILE*fp_;charcurrent_;size_tcount_;};}// namespace rapidjson#endif // RAPIDJSON_FILESTREAM_H_