12 #ifndef vtkGenericIOUtilities_h 13 #define vtkGenericIOUtilities_h 28 class GenericIOReader;
29 class GenericIOWriter;
40 inline std::string&
ltrim(std::string& s)
42 s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](
int ch) {
return !std::isspace(ch); }));
52 inline std::string&
rtrim(std::string& s)
55 std::find_if(s.rbegin(), s.rend(), [](
int ch) {
return !std::isspace(ch); }).base(), s.end());
64 inline std::string&
trim(std::string& s)
105 MPI_Comm comm,
bool posix,
int distribution,
const std::string& fileName);
112 gio::GenericIOWriter*
GetWriter(MPI_Comm comm,
const std::string& fileName);
void SafeDeleteString(char *&str)
If the pointer given is non-nullptr this function deletes the string and set the pointer to nullptr...
MPI_Comm GetMPICommunicator(vtkMultiProcessController *mpc)
Returns the corresponding MPI communicator for the multi-process controller used by this instance...
gio::GenericIOWriter * GetWriter(MPI_Comm comm, const std::string &fileName)
This method constructs and returns the underlying GenericIO writer.
std::string & trim(std::string &s)
Trims leading & trailing whitespace from a string.
double GetDoubleFromRawBuffer(const int type, void *buffer, vtkIdType buffer_idx)
This method accesses the user-supplied buffer at the given index and returns the data as a double...
std::string & ltrim(std::string &s)
Trims leading whitespace from a string.
vtkIdType GetIdFromRawBuffer(const int type, void *buffer, vtkIdType buffer_idx)
This method accesses the user-supplied buffer at the given index and returns the data as a vtkIdType...
vtkDataArray * GetVtkDataArray(std::string name, int type, void *rawBuffer, int N)
This method parses the data in the rawbuffer and reads it into a vtkDataArray that can be attached as...
std::string & rtrim(std::string &s)
Trims trailing whitespace from a string.
gio::GenericIOReader * GetReader(MPI_Comm comm, bool posix, int distribution, const std::string &fileName)
This method constructs and returns the underlying GenericIO reader.