12 #ifndef vtkGenericIOUtilities_h 13 #define vtkGenericIOUtilities_h 28 class GenericIOReader;
29 class GenericIOWriter;
40 inline std::string&
ltrim(std::string& s)
43 s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
53 inline std::string&
rtrim(std::string& s)
56 std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(),
66 inline std::string&
trim(std::string& s)
107 MPI_Comm comm,
bool posix,
int distribution,
const std::string& fileName);
114 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.