PIDUINO
Loading...
Searching...
No Matches
filestream.h
1/* Copyright © 2018-2025 Pascal JEAN, All rights reserved.
2 * This file is part of the Piduino Library.
3 *
4 * The Piduino Library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 3 of the License, or (at your option) any later version.
8 *
9 * The Piduino Library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with the Piduino Library; if not, see <http://www.gnu.org/licenses/>.
16 */
17#pragma once
18
19#include <string>
20#include <iostream>
21#include <piduino/filedevice.h>
22
28namespace Piduino {
29
34 class FileStream : public FileDevice, public std::iostream {
35
36 public:
37
42
46 FileStream (const std::string & path);
47
56 virtual ssize_t write (const char * data, size_t maxSize);
57
67 ssize_t write (const char * str);
68
77 ssize_t write (const std::string & str);
78
87 ssize_t write (char c);
88
103 virtual ssize_t read (char * data, size_t maxSize);
104
105
106 protected:
107 class Private;
109
110 private:
112 };
113}
118/* ========================================================================== */
Provides an interface for reading from and writing to files.
Definition filedevice.h:45
virtual std::string path() const
Provides an interface for reading from and writing to files with stream.
Definition filestream.h:34
FileStream(const std::string &path)
ssize_t write(const char *str)
virtual ssize_t read(char *data, size_t maxSize)
ssize_t write(const std::string &str)
ssize_t write(char c)
FileStream(Private &dd)
virtual ssize_t write(const char *data, size_t maxSize)
Internal implementation class for GpioDevice.
#define PIMP_DECLARE_PRIVATE(Class)
PIMP_DECLARE_PRIVATE.
Definition global.h:82
Global namespace for Piduino.
Definition board.h:28