Teuchos - Trilinos Tools Package
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
parameterlist
src
Teuchos_StringInputStream.cpp
1
// @HEADER
2
// *****************************************************************************
3
// Teuchos: Common Tools Package
4
//
5
// Copyright 2004 NTESS and the Teuchos contributors.
6
// SPDX-License-Identifier: BSD-3-Clause
7
// *****************************************************************************
8
// @HEADER
9
10
#include "
Teuchos_StringInputStream.hpp
"
11
12
using namespace
Teuchos
;
13
14
15
unsigned
int
StringInputStream::readBytes
(
unsigned
char
*
const
toFill,
16
const
unsigned
int
maxToRead)
17
{
18
if
(pos_ == text_.length())
return
0;
19
20
int
toRead =
static_cast<
int
>
(text_.length() - pos_);
21
if
((
int
) maxToRead < toRead) toRead = maxToRead;
22
23
std::strncpy((
char
*) toFill, text_.c_str()+pos_, toRead);
24
25
pos_ += toRead;
26
27
return
(
size_t
) toRead;
28
}
29
Teuchos_StringInputStream.hpp
Definition of XMLInputStream derived class for reading XML from a std::string.
Teuchos::StringInputStream::readBytes
virtual unsigned int readBytes(unsigned char *const toFill, const unsigned int maxToRead)
Read up to maxToRead bytes.
Definition
Teuchos_StringInputStream.cpp:15
Teuchos
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
Generated by
1.17.0