SUNphi  1.0
File.hpp File Reference

Access to filesystem. More...

#include <filesystem>
#include <metaprogramming/UniversalReferences.hpp>
#include <debug/MinimalCrash.hpp>

Go to the source code of this file.

Classes

class  SUNphi::File
 File access, with functionalities to open and close, write/read. More...
 

Macros

#define SCOPE_INDENT(VAR)
 Mark the stream to be more indented. More...
 
#define SET_FOR_CURRENT_SCOPE(NAME, VAR, ...)   auto NAME3(SET,NAME,__LINE__)=getScopeChangeVar(VAR,__VA_ARGS__)
 Set for current scope.
 
#define SCOPE_REAL_PRECISION(STREAM, VAL)   SET_FOR_CURRENT_SCOPE(STREAM_REAL_PRECISION,STREAM.realPrecision,VAL)
 Set the precision for current scope.
 
#define SCOPE_REAL_FORMAT(STREAM, VAL)   SET_FOR_CURRENT_SCOPE(STREAM_REAL_FORMAT,STREAM.realFormat,VAL)
 Set the format for current scope.
 
#define SCOPE_REAL_FORMAT_GENERAL(STREAM)   SET_FOR_CURRENT_SCOPE(STREAM_REAL_FORMAT_GENERAL,STREAM.realFormat,RealFormat::GENERAL)
 Set general for the current scope.
 
#define SCOPE_REAL_FORMAT_FIXED(STREAM)   SET_FOR_CURRENT_SCOPE(STREAM_REAL_FORMAT_FIXED,STREAM.realFormat,RealFormat::FIXED)
 Set fixed for the current scope.
 
#define SCOPE_REAL_FORMAT_ENGINEER(STREAM)   SET_FOR_CURRENT_SCOPE(STREAM_REAL_FORMAT_ENGINEER,STREAM.realFormat,RealFormat::ENGINEER)
 Set engineer for the current scope.
 
#define SCOPE_ALWAYS_PUT_SIGN(STREAM)   SET_FOR_CURRENT_SCOPE(STREAM_ALWAYS_PRINT_SIGN,STREAM.alwaysPrintSign,true)
 Set printing always sign at the beginning of a number for current scope.
 
#define SCOPE_NOT_ALWAYS_PUT_SIGN(STREAM)   SET_FOR_CURRENT_SCOPE(STREAM_NOT_ALWAYS_PRINT_SIGN,STREAM.alwaysPrintSign,false)
 Set not to print always sign at the beginning of a number for current scope.
 
#define SCOPE_ALWAYS_PRINT_ZERO(STREAM)   SET_FOR_CURRENT_SCOPE(STREAM_ALWAYS_PRINT_ZERO,STREAM.alwaysPrintZero,true)
 Set printing or not zero.
 
#define SCOPE_ALWAYS_PRINT_ZERO(STREAM)   SET_FOR_CURRENT_SCOPE(STREAM_ALWAYS_PRINT_ZERO,STREAM.alwaysPrintZero,true)
 Set printing or not zero.
 
#define SCOPE_ALL_RANKS_CAN_PRINT(STREAM)   SET_FOR_CURRENT_SCOPE(STREAM_ALL_RANKS_CAN_PRINT,STREAM.onlyMasterRankPrint,false)
 Allows all ransk to print for current scope.
 

Functions

bool SUNphi::fileExists (const std::filesystem::path &path)
 Returns whether the given path exists. More...
 
std::uintmax_t SUNphi::fileSize (const std::filesystem::path &path)
 Returns the size of a file. More...
 

Detailed Description

Access to filesystem.

Definition in file File.hpp.

Macro Definition Documentation

#define SCOPE_INDENT (   VAR)
Value:
\
ScopeIndenter NAME2(SCOPE_INDENTER,__LINE__)(VAR)
#define NAME2(X, Y)
Merges two tokens using a _.
Definition: Macros.hpp:33

Mark the stream to be more indented.

Definition at line 16 of file File.hpp.

Function Documentation

bool SUNphi::fileExists ( const std::filesystem::path &  path)
inline

Returns whether the given path exists.

Parameters
pathPath to open

Definition at line 65 of file File.hpp.

std::uintmax_t SUNphi::fileSize ( const std::filesystem::path &  path)
inline

Returns the size of a file.

Parameters
pathPath to probe

Definition at line 72 of file File.hpp.