BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_Ascii.hpp
Go to the documentation of this file.
1/*
2 * BELFEM -- The Berkeley Lab Finite Element Framework
3 * Copyright (c) 2026, The Regents of the University of California,
4 * through Lawrence Berkeley National Laboratory (subject to receipt of any required
5 * approvals from the U.S. Dept. of Energy). All rights reserved.
6 *
7 * Developers: Christian Messe, Gregory Giard
8 *
9 * See the top-level LICENSE file for the complete license and disclaimer.
10 */
11
12#ifndef BELFEM_CL_ASCII_HPP
13#define BELFEM_CL_ASCII_HPP
14
15
16
17#include "typedefs.hpp"
18#include "cl_Cell.hpp"
19#include "filetools.hpp"
20
21namespace belfem
22{
23//------------------------------------------------------------------------------
24
31 class Ascii
32 {
33//------------------------------------------------------------------------------
34 protected:
35//------------------------------------------------------------------------------
36
37 string mPath;
40
42
43//------------------------------------------------------------------------------
44 public:
45//------------------------------------------------------------------------------
46
47 Ascii( const string & aPath,
48 const enum FileMode & aMode );
49
50//------------------------------------------------------------------------------
51
52 virtual ~Ascii();
53
54//------------------------------------------------------------------------------
55
56 // save the buffer to the file
57 bool
58 save();
59
60//------------------------------------------------------------------------------
61
62 void
63 print( const std::string & aLine );
64
65//------------------------------------------------------------------------------
66
71 length() const;
72
73//------------------------------------------------------------------------------
74
75 string &
76 line( const index_t aLineNumber );
77
78//------------------------------------------------------------------------------
79
80 const string &
81 line( const index_t aLineNumber ) const;
82//------------------------------------------------------------------------------
83 private:
84//------------------------------------------------------------------------------
85
86 void
87 load_buffer( const bool aParallelMode );
88
89//------------------------------------------------------------------------------
90 };
91
92//------------------------------------------------------------------------------
93}
94#endif //BELFEM_CL_ASCII_HPP
string mPath
Definition cl_Ascii.hpp:37
const FileMode mMode
Definition cl_Ascii.hpp:38
index_t length() const
return the number of lines
Definition cl_Ascii.cpp:111
bool mChangedSinceLastSave
Definition cl_Ascii.hpp:41
bool save()
Definition cl_Ascii.cpp:76
Cell< string > mBuffer
Definition cl_Ascii.hpp:39
string & line(const index_t aLineNumber)
Definition cl_Ascii.cpp:119
void print(const std::string &aLine)
Definition cl_Ascii.cpp:135
Ascii(const string &aPath, const enum FileMode &aMode)
Definition cl_Ascii.cpp:25
USER GUIDES:
Definition cl_Capacitor.cpp:16
FileMode
Definition filetools.hpp:27
uint32_t index_t
Definition typedefs.hpp:52