A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/istreamwrapper_8h_source.html below:

NCBI C++ ToolKit: include/misc/jsonwrapp/rapidjson11/istreamwrapper.h Source File

Go to the documentation of this file.

Go to the SVN repository for this file.

15 #ifndef RAPIDJSON_ISTREAMWRAPPER_H_ 16 #define RAPIDJSON_ISTREAMWRAPPER_H_ 23

RAPIDJSON_DIAG_OFF(padded)

28

RAPIDJSON_DIAG_OFF(4351)

49 template

<

typename

StreamType>

56

: stream_(stream), count_(), peekBuffer_(),

57

bufferSize_(bufferSize),

buffer

(new

Ch

[bufferSize_])

59

bufferLast_ = current_ =

buffer

.get();

61

pos_ = stream_.tellg();

67

stream_.seekg(pos_ + count_);

82  typename

StreamType::int_type c = stream_.peek();

83  return RAPIDJSON_LIKELY

(c != StreamType::traits_type::eof()) ?

static_cast<

Ch

>

(c) :

static_cast<

Ch

>

(

'\0'

);

87  typename

StreamType::int_type c = stream_.get();

90  return static_cast<

Ch

>

(c);

98  size_t Tell

()

const

{

return

count_; }

109  bool

hasError =

false

;

110  for

(

i

= 0;

i

< 4; ++

i

) {

111  typename

StreamType::int_type c = stream_.get();

112  if

(c == StreamType::traits_type::eof()) {

117

peekBuffer_[

i

] =

static_cast<Ch>

(c);

119  for

(--

i

;

i

>= 0; --

i

)

120

stream_.putback(peekBuffer_[

i

]);

121  return

!hasError ? peekBuffer_ : 0;

130  mutable Ch

peekBuffer_[4];

141  if

(current_ < bufferLast_) {

145  if

(!eof_ && current_ == bufferLast_) {

147

stream_.read(current_, bufferSize_);

148

bufferLast_ = current_ + stream_.gcount();

149  if

(current_ == bufferLast_) {

161 #if defined(__clang__) || defined(_MSC_VER)

Wrapper of std::basic_istream into RapidJSON's Stream concept.

BasicIStreamWrapper(const BasicIStreamWrapper &)

BasicIStreamWrapper & operator=(const BasicIStreamWrapper &)

std::unique_ptr< Ch[]> buffer

size_t count_

Number of characters read. Note:

BasicIStreamWrapper(StreamType &stream, size_t bufferSize=16 *1024)

void Read(CObjectIStream &in, TObjectPtr object, const CTypeRef &type)

#define RAPIDJSON_LIKELY(x)

Compiler branching hint for expression with high probability to be true.

#define RAPIDJSON_ASSERT(x)

Assertion.

#define RAPIDJSON_NAMESPACE_BEGIN

provide custom rapidjson namespace (opening expression)

#define RAPIDJSON_NAMESPACE_END

provide custom rapidjson namespace (closing expression)

string_type::value_type char_type

The character type used by the parser.

BasicIStreamWrapper< std::istream > IStreamWrapper

BasicIStreamWrapper< std::wistream > WIStreamWrapper


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4