MPSolve
3.2.2
Toggle main menu visibility
Loading...
Searching...
No Matches
memory-file-stream.h
Go to the documentation of this file.
1
/*
2
* This file is part of MPSolve 3.2.2
3
*
4
* Copyright (C) 2001-2020, Dipartimento di Matematica "L. Tonelli", Pisa.
5
* License: http://www.gnu.org/licenses/gpl.html GPL version 3 or higher
6
*
7
* Authors:
8
* Leonardo Robol <leonardo.robol@unipi.it>
9
*/
10
15
16
#ifndef MPS_MEMORY_FILE_STREAM_H_
17
#define MPS_MEMORY_FILE_STREAM_H_
18
19
MPS_BEGIN_DECLS
20
24
struct
mps_memory_file_stream
;
25
29
typedef
struct
mps_memory_file_stream
mps_memory_file_stream
;
30
37
mps_memory_file_stream
*
mps_memory_file_stream_new
(
const
char
* source);
38
44
void
mps_memory_file_stream_free
(
mps_memory_file_stream
* stream);
45
46
MPS_END_DECLS
47
48
#ifdef __cplusplus
49
50
#include <iostream>
51
#include <sstream>
52
53
#include <
mps/mps.h
>
54
55
namespace
mps {
61
class
MemoryFileStream
:
public
AbstractInputStream
{
62
public
:
63
71
MemoryFileStream
(
const
char
* source);
72
73
~MemoryFileStream
();
74
86
size_t
readline
(
char
** buffer,
size_t
* length);
87
93
bool
eof
();
94
100
int
getchar
();
101
102
private
:
103
std::istringstream mInputStream;
104
};
105
}
106
107
#endif
108
109
#endif
/* MPS_MEMORY_FILE_STREAM_H_ */
110
mps::AbstractInputStream
Abstract class that represent a generic input stream that can be used by MPSolve to read polynomial f...
Definition
abstract-input-stream.h:62
mps::MemoryFileStream::getchar
int getchar()
Obtain a single character.
Definition
memory-file-stream.cpp:73
mps::MemoryFileStream::MemoryFileStream
MemoryFileStream(const char *source)
Allocate a new MemoryFileStream that wil provide that data stored by the given pointer.
Definition
memory-file-stream.cpp:33
mps::MemoryFileStream::eof
bool eof()
Implementation of the eof() method of AbstractInputStream.
Definition
memory-file-stream.cpp:67
mps::MemoryFileStream::readline
size_t readline(char **buffer, size_t *length)
Implementation of the readline() method of the AbstractInputStream parent.
Definition
memory-file-stream.cpp:43
mps_memory_file_stream_new
mps_memory_file_stream * mps_memory_file_stream_new(const char *source)
Allocate a new MemoryFileStream that will output the data pointed by source.
Definition
memory-file-stream.cpp:19
mps_memory_file_stream_free
void mps_memory_file_stream_free(mps_memory_file_stream *stream)
Release the resources holded by a MemoryFileStream.
Definition
memory-file-stream.cpp:25
mps_memory_file_stream
struct mps_memory_file_stream mps_memory_file_stream
C wrapper around MemoryFileStream.
Definition
memory-file-stream.h:29
mps.h
Header file for libmps.
include
mps
private
system
memory-file-stream.h
Generated on
for MPSolve by
1.17.0