Loading...
Searching...
No Matches
fileHandler.hpp
1/*---------------------------------------------------------------------------*\
2 *
3 * bitpit
4 *
5 * Copyright (C) 2015-2021 OPTIMAD engineering Srl
6 *
7 * -------------------------------------------------------------------------
8 * License
9 * This file is part of bitpit.
10 *
11 * bitpit is free software: you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License v3 (LGPL)
13 * as published by the Free Software Foundation.
14 *
15 * bitpit is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with bitpit. If not, see <http://www.gnu.org/licenses/>.
22 *
23\*---------------------------------------------------------------------------*/
24#ifndef __BITPIT_FILEHANDLER_HPP__
25#define __BITPIT_FILEHANDLER_HPP__
26
27#include <iostream>
28#include <iomanip>
29#include <fstream>
30#include <sstream>
31
32#include "bitpit_common.hpp"
33
34namespace bitpit{
35
48
49 private:
50 std::string directory;
51 std::string name;
52 std::string appendix ;
54 bool series ;
55 int counter ;
57 bool parallel ;
58 int block ;
60 public:
61 BITPIT_PUBLIC_API static const int INVALID_COUNTER = -1;
63 FileHandler() ;
64 FileHandler( const std::string & dir_, const std::string & name_, const std::string & app_) ;
65 FileHandler( const FileHandler& other ) ;
66
67 FileHandler& operator=( const FileHandler& other) ;
68
69 bool exists() const ;
70
71 std::string getPath() const ;
72 const std::string & getDirectory() const ;
73 const std::string & getName() const ;
74 const std::string & getAppendix() const ;
75 void setDirectory( const std::string & d_) ;
76 void setName( const std::string & n_) ;
77 void setAppendix( const std::string & a_) ;
78
79 bool isSeries( ) const ;
80 void setSeries( bool s_) ;
81
82 int getCounter() const ;
83 void setCounter(int c_);
84 void incrementCounter();
85
86 bool isParallel( ) const ;
87 void setParallel( bool p_) ;
88
89 int getBlock( ) const ;
90 void setBlock( int b_) ;
91
92};
93
94}
95
96#endif
Creates file names and checks status.
std::string getPath() const
void setParallel(bool p_)
static BITPIT_PUBLIC_API const int INVALID_COUNTER
bool isSeries() const
bool isParallel() const
const std::string & getDirectory() const
void setDirectory(const std::string &d_)
const std::string & getAppendix() const
void setName(const std::string &n_)
FileHandler & operator=(const FileHandler &other)
bool exists() const
void setCounter(int c_)
const std::string & getName() const
void setBlock(int b_)
void setSeries(bool s_)
void setAppendix(const std::string &a_)
--- layout: doxygen_footer ---