LibraryLink Utilities  3.0.1
Modern C++ wrapper over LibraryLink and WSTP
FileUtilities.h File Reference

Detailed Description

#include <codecvt>
#include <cstdio>
#include <fstream>
#include <ios>
#include <locale>
#include <memory>
#include <string>
+ Include dependency graph for FileUtilities.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  LLU::SharePolicy
 Base class for shared access policies on Windows. More...
 
struct  LLU::AlwaysReadExclusiveWrite
 Default policy for Import/Export paclets - always allow reading, deny writing when we write. More...
 

Namespaces

 LLU
 Main namespace of LibraryLink Utilities.
 

Type aliases

using LLU::FilePtr = std::unique_ptr< std::FILE, int(*)(std::FILE *)>
 Smart pointer type around std::FILE. More...
 

Functions

FilePtr LLU::claimFile (std::FILE *f)
 Create a unique owning pointer of a FILE. More...
 
void LLU::validatePath (const std::string &fileName, std::ios::openmode mode)
 Check if the file fileName under open mode mode is accessible in the current sandbox setting. More...
 
template<typename T >
std::basic_string< T > LLU::fromUTF8toUTF16 (const std::string &source)
 Convert string from UTF8 to UTF16. More...
 
template<typename T >
std::string LLU::fromUTF16toUTF8 (const std::basic_string< T > &source)
 Convert string from UTF16 to UTF8. More...
 
template<typename T >
std::basic_string< T > LLU::fromUTF8toUTF32 (const std::string &source)
 Convert string from UTF8 to UTF32. More...
 
template<typename T >
std::string LLU::fromUTF32toUTF8 (const std::basic_string< T > &source)
 Convert string from UTF32 to UTF8. More...
 
FilePtr LLU::openFile (const std::string &fileName, std::ios::openmode mode, const SharePolicy &shp=AlwaysReadExclusiveWrite {})
 Open given file with specified mode (read, write, append, etc.). More...
 
std::fstream LLU::openFileStream (const std::string &fileName, std::ios::openmode mode, const SharePolicy &shp=AlwaysReadExclusiveWrite {})
 Open a file stream with specified mode (read, write, append, etc.). More...