VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
UbFileInputASCII.h
Go to the documentation of this file.
1//=======================================================================================
2// ____ ____ __ ______ __________ __ __ __ __
3// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
4// \ \ | | | | | |_) | | | | | | | / \ | |
5// \ \ | | | | | _ / | | | | | | / /\ \ | |
6// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
7// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
8// \ \ | | ________________________________________________________________
9// \ \ | | | ______________________________________________________________|
10// \ \| | | | __ __ __ __ ______ _______
11// \ | | |_____ | | | | | | | | | _ \ / _____)
12// \ | | _____| | | | | | | | | | | \ \ \_______
13// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
14// \ _____| |__| |________| \_______/ |__| |______/ (_______/
15//
16// This file is part of VirtualFluids. VirtualFluids is free software: you can
17// redistribute it and/or modify it under the terms of the GNU General Public
18// License as published by the Free Software Foundation, either version 3 of
19// the License, or (at your option) any later version.
20//
21// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
22// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24// for more details.
25//
26// SPDX-License-Identifier: GPL-3.0-or-later
27// SPDX-FileCopyrightText: Copyright © VirtualFluids Project contributors, see AUTHORS.md in root folder
28//
33//=======================================================================================
34#ifndef UBFILEINPUTASCII_H
35#define UBFILEINPUTASCII_H
36
37#include <fstream>
38#include <iostream>
39#include <string>
40
41
42
45
46/*=========================================================================*/
47/* UbFileInputASCII */
48/* */
56/*
57usage: ...
58*/
59
61{
62public:
65
66 bool open(std::string filename) override;
67
68 std::string getFileName() override;
69 void skipLine() override; // Springt zur naechsten Zeile
70
71 void readLine() override;
72 std::string readStringLine() override;
73 int readInteger() override; // Liest einen Int-Wert ein
74 long long readLongLong(); // Liest einen long-Wert ein
75
76 std::size_t readSize_t() override;
77 double readDouble() override; // Liest einen double-Wert ein
78 float readFloat() override; // Liest einen float-Wert ein
79 bool readBool() override; // Liest einen bool-Wert ein
80 char readChar() override; // Liest einen char-Wert ein
81 std::string readString() override; // Liest ein Wort ein
82 std::string readLineTill(char stop) override; // Liest gesamte Zeile ein bis zu einem bestimmten Zeichen
83 std::string parseString() override;
84
85 bool containsString(const std::string &var) override;
86 void setPosAfterLineWithString(const std::string &var) override;
87 int readIntegerAfterString(const std::string &var) override;
88 double readDoubleAfterString(const std::string &var) override;
89 bool readBoolAfterString(const std::string &var) override;
90 std::string readStringAfterString(const std::string &var) override;
91
92 FILETYPE getFileType() override { return ASCII; }
93
94 template <typename T>
95 friend inline UbFileInputASCII &operator>>(UbFileInputASCII &file, T &data)
96 {
97 file.infile >> data;
98 return file;
99 }
100};
101
102#endif // UBFILEINPUTASCII_H
103
UbFileInputASCII(std::string filename)
FILETYPE getFileType() override
friend UbFileInputASCII & operator>>(UbFileInputASCII &file, T &data)
std::string filename
std::ifstream infile
std::shared_ptr< T > SPtr
bool readBoolAfterString(const std::string &var) override
std::string getFileName() override
std::size_t readSize_t() override
bool open(std::string filename) override
char readChar() override
std::string readString() override
void skipLine() override
int readInteger() override
double readDouble() override
double readDoubleAfterString(const std::string &var) override
void readLine() override
bool containsString(const std::string &var) override
void setPosAfterLineWithString(const std::string &var) override
std::string readLineTill(char stop) override
std::string readStringLine() override
float readFloat() override
int readIntegerAfterString(const std::string &var) override
std::string parseString() override
std::string readStringAfterString(const std::string &var) override
bool readBool() override