GlobalObjects
Loading...
Searching...
No Matches
EuFileHelper.h File Reference

Header for FileHelper More...

#include <EuToolTypes.h>
#include <string>
#include <fstream>
#include <vector>

Go to the source code of this file.

Classes

class  eut::FileHelper::CallBackFileDirFount
 

Namespaces

namespace  eut
 
namespace  eut::FileHelper
 Helper with static methods for processing the file system.
 

Typedefs

typedef void(* eut::FileHelper::PROCESSING_DIR_MEMBERPTR) (const fs::path &rFullPathName)
 
typedef void(* eut::FileHelper::PROCESSING_FILE_MEMBERPTR) (const fs::path &rFullFileName)
 

Functions

int eut::FileHelper::_iterateDirectory (const fs::path &rIterPath, bool bRecursive, PROCESSING_FILE_MEMBERPTR ProcessingFileFunction, PROCESSING_DIR_MEMBERPTR ProcessingDirFunction, CallBackFileDirFount *pProcessingObject)
 
__tool_export_dll int eut::FileHelper::closeInputFile (std::ifstream *&pFileStream)
 
__tool_export_dll int eut::FileHelper::closeInputFile (std::wifstream *&pFileStream)
 
__tool_export_dll int eut::FileHelper::closeOutputFile (std::ofstream *&pFileStream)
 
__tool_export_dll int eut::FileHelper::closeOutputFile (std::wofstream *&pFileStream)
 
__tool_export_dll int eut::FileHelper::copyFile (const std::string &rsSourceFileName, const std::string &rsTargetFileName)
 
__tool_export_dll int eut::FileHelper::deleteFile (const fs::path &rFullFileName)
 
__tool_export_dll int eut::FileHelper::deleteFile (const std::string &rsFullFileName)
 
__tool_export_dll void eut::FileHelper::deleteFileForIterateDirectory (const fs::path &rFullFileName)
 
__tool_export_dll int eut::FileHelper::dirExist (const std::string &rsCheckPath)
 
__tool_export_dll int eut::FileHelper::dirExist (const std::wstring &rsCheckPath)
 
__tool_export_dll int eut::FileHelper::fileExist (const std::string &rsFullFileName)
 
__tool_export_dll int eut::FileHelper::fileExist (const std::wstring &rsFullFileName)
 
__tool_export_dll std::string eut::FileHelper::getCurrentWorkingDirAsString ()
 
__tool_export_dll std::wstring eut::FileHelper::getCurrentWorkingDirAsWString ()
 
__tool_export_dll int eut::FileHelper::iterateDirectory (const fs::path &rIterPath, bool bRecursive, CallBackFileDirFount &rProcessingObject)
 
__tool_export_dll int eut::FileHelper::iterateDirectory (const fs::path &rIterPath, bool bRecursive, PROCESSING_FILE_MEMBERPTR ProcessingFileFunction, PROCESSING_DIR_MEMBERPTR ProcessingDirFunction)
 
__tool_export_dll int eut::FileHelper::loadFile (std::string &rstr, const std::string &rsFileName)
 
__tool_export_dll int eut::FileHelper::lockFile (std::ofstream *&prLockFile, const std::string &rsLockFileName)
 
__tool_export_dll int eut::FileHelper::storeFile (const std::string &rsStr, const std::string &rsFileName)
 
__tool_export_dll int eut::FileHelper::storeFile (char *pszData, std::streamsize nSize, const std::string &rsFileName)
 Saves data to a file in the file system.
 
__tool_export_dll int eut::FileHelper::storeFile (char *pszData, std::streamsize nSize, const std::wstring &rsFileName)
 Saves data to a file in the file system.
 
__tool_export_dll int eut::FileHelper::storeFile (const Blob *pBlob, const std::string &rsFileName)
 Saves the contents of a blob to a file in the file system.
 
__tool_export_dll int eut::FileHelper::storeFile (const Blob *pBlob, const std::wstring &rsFileName)
 Saves the contents of a blob to a file in the file system.
 
__tool_export_dll int eut::FileHelper::storeFile (const Blob &rBlob, const std::string &rsFileName)
 Saves the contents of a blob to a file in the file system.
 
__tool_export_dll int eut::FileHelper::storeFile (const Blob &rBlob, const std::wstring &rsFileName)
 Saves the contents of a blob to a file in the file system.
 
__tool_export_dll int eut::FileHelper::loadFile (char *&prszData, std::streamsize &rnSize, const std::string &rsFileName, bool bText=false)
 Returns the content and size of a file from the file system.
 
__tool_export_dll int eut::FileHelper::loadFile (char *&prszData, std::streamsize &rnSize, const std::wstring &rsFileName, bool bText=false)
 Returns the content and size of a file from the file system.
 
__tool_export_dll int eut::FileHelper::loadFile (Blob *&prBlob, const std::string &rsFileName)
 
__tool_export_dll int eut::FileHelper::loadFile (Blob *&prBlob, const std::wstring &rsFileName)
 
__tool_export_dll int eut::FileHelper::loadFile (Blob &rBlob, const std::string &rsFileName)
 Returns the contents of a file from the file system.
 
__tool_export_dll int eut::FileHelper::loadFile (Blob &rBlob, const std::wstring &rsFileName)
 Returns the contents of a file from the file system.
 
__tool_export_dll int eut::FileHelper::openInputFile (std::ifstream *&pInputFileStream, const std::string &rsFileName)
 Returns an open file of type std::ifstream for writing to the File system.
 
__tool_export_dll int eut::FileHelper::openInputFile (std::ifstream *&pInputFileStream, const std::wstring &rsFileName)
 Returns an open file of type std::ifstream for writing to the File system.
 
__tool_export_dll int eut::FileHelper::openInputFile (std::wifstream *&pInputFileStream, const std::string &rsFileName)
 Returns an open file of type std::wifstream for writing to the File system.
 
__tool_export_dll int eut::FileHelper::openInputFile (std::wifstream *&pInputFileStream, const std::wstring &rsFileName)
 Returns an open file of type std::wifstream for writing to the File system.
 
__tool_export_dll int eut::FileHelper::openOutputFile (std::ofstream *&pOutputFileStream, const std::string &rsFileName)
 Returns an open file of type std::ofstream for reading in the file system.
 
__tool_export_dll int eut::FileHelper::openOutputFile (std::ofstream *&pOutputFileStream, const std::wstring &rsFileName)
 Returns an open file of type std::ofstream for reading in the file system.
 
__tool_export_dll int eut::FileHelper::openOutputFile (std::wofstream *&pOutputFileStream, const std::string &rsFileName)
 Returns an open file of type std::wofstream for reading in the file system.
 
__tool_export_dll int eut::FileHelper::openOutputFile (std::wofstream *&pOutputFileStream, const std::wstring &rsFileName)
 Returns an open file of type std::wofstream for reading in the file system.
 
__tool_export_dll int eut::FileHelper::makeDir (const std::string &rsNewPath)
 Creates passed directory(s).
 
__tool_export_dll int eut::FileHelper::makeDir (const std::wstring &rsNewPath)
 Creates passed directory(s).
 
__tool_export_dll int eut::FileHelper::makePath (const std::string &rsNewPath)
 Creates passed directory(s).
 
__tool_export_dll int eut::FileHelper::makePath (const std::wstring &rsNewPath)
 Creates passed directory(s).
 
__tool_export_dll void eut::FileHelper::splitPath (const std::string &rsFullFileName, std::string &rsDrive, std::string &rsPath, std::string &rsFileName, std::string &rsFileExtension)
 Expects a file name including path (e.g.
 
__tool_export_dll void eut::FileHelper::splitPath (const std::wstring &rsFullFileName, std::wstring &rsDrive, std::wstring &rsPath, std::wstring &rsFileName, std::wstring &rsFileExtension)
 Expects a file name including path (e.g.
 
__tool_export_dll void eut::FileHelper::getFullFileName (std::string &rsFullFileName, const fs::path &rFileSystemPath, const char &rSeparator='/')
 Sets the full file name in the passed string from the passed fs::path, even if it is only relative.
 
__tool_export_dll void eut::FileHelper::getFullFileName (std::wstring &rsFullFileName, const fs::path &rFileSystemPath, const std::wstring &rSeparator=L"/")
 Sets the full file name in the passed string from the passed fs::path, even if it is only relative.
 
int eut::FileHelper::_getswapDatavalue (std::string &sOutText, const std::string &sInText, const std::string &sTextOrFile)
 Helper function for swapDataInFile (...) which contains a value in a std::string which either comes from a file or as a regular expression or is determined as text.
 
int eut::FileHelper::_getswapDatavalue (std::string &sOutText, const std::wstring &sInText, const std::string &sTextOrFile)
 Helper function for swapDataInFile (...) which contains a value in a std::string which either comes from a file or as a regular expression or is determined as text.
 
__tool_export_dll int eut::FileHelper::swapDataInFile (std::vector< std::string > &rParamVector, bool bSimulate=false)
 Searches and replaces contents in files and saves them under a different name if desired.
 

Detailed Description

Header for FileHelper

Author
Helmut Jakoby

Terms of License The source code in this file is licensed.

SPDX-License-Identifier: LicenseRef-Helmut-Jakoby-Commercial-License OR LicenseRef-Helmut-Jakoby-Adapted-Prosperity-Public-License OR AGPL-3.0-or-later

Helmut-Jakoby-Commercial-License
For OEMs (Original Equipment Manufacturers), ISVs (Independent Software Vendors), VARs (Value Added Resellers) and other distributors who combine commercially licensed software with Software © by Helmut Jakoby and distribute it as such or in conjunction with another product and do not wish to publish the source code of the commercially licensed software under any other license that may be offered, a commercial license is available for this purpose. Please review the following information to ensure the Commercial-License requirements will be met: https://globalobjects.de/hjacomlicense_en.html .

Helmut-Jakoby-Adapted-Prosperity-Public-License
For developers of free, non-commercial software applications who want to combine and distribute their application with Software © by Helmut Jakoby, this license is a good option. Please review the following information to ensure the Adapted-Prosperity-Public-License requirements will be met: https://globalobjects.de/hjappllicense_en.html .

GNU Affero General Public License Usage
You can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. Please review the following information to ensure the GNU Affero General Public License requirements will be met: https://www.gnu.org/licenses/agpl-3.0.en.html .