tesseract  5.0.0
file Class Reference

#include <include_gunit.h>

Inheritance diagram for file:
tesseract::File

Static Public Member Functions

static void MakeTmpdir ()
 
static bool WriteStringToFile (const std::string &contents, const std::string &filename)
 
static bool GetContents (const std::string &filename, std::string *out, int)
 
static bool SetContents (const std::string &name, const std::string &contents, bool)
 
static int Defaults ()
 
static std::string JoinPath (const std::string &s1, const std::string &s2)
 
static std::string JoinPath (const std::string &s1, const std::string &s2, const std::string &s3)
 
- Static Public Member Functions inherited from tesseract::File
static FILE * OpenOrDie (const std::string &filename, const std::string &mode)
 
static FILE * Open (const std::string &filename, const std::string &mode)
 
static void WriteStringToFileOrDie (const std::string &str, const std::string &filename)
 
static bool Readable (const std::string &filename)
 
static bool ReadFileToString (const std::string &filename, std::string *out)
 
static std::string JoinPath (const std::string &prefix, const std::string &suffix)
 
static bool Delete (const char *pathname)
 
static bool DeleteMatchingFiles (const char *pattern)
 

Detailed Description

Definition at line 36 of file include_gunit.h.

Member Function Documentation

◆ Defaults()

static int file::Defaults ( )
inlinestatic

Definition at line 61 of file include_gunit.h.

61  {
62  return 0;
63  }

◆ GetContents()

static bool file::GetContents ( const std::string &  filename,
std::string *  out,
int   
)
inlinestatic

Definition at line 52 of file include_gunit.h.

52  {
53  return File::ReadFileToString(filename, out);
54  }

◆ JoinPath() [1/2]

static std::string file::JoinPath ( const std::string &  s1,
const std::string &  s2 
)
inlinestatic

Definition at line 65 of file include_gunit.h.

65  {
66  return tesseract::File::JoinPath(s1, s2);
67  }
static std::string JoinPath(const std::string &prefix, const std::string &suffix)
Definition: fileio.cpp:84

◆ JoinPath() [2/2]

static std::string file::JoinPath ( const std::string &  s1,
const std::string &  s2,
const std::string &  s3 
)
inlinestatic

Definition at line 69 of file include_gunit.h.

69  {
70  return JoinPath(JoinPath(s1, s2), s3);
71  }
static std::string JoinPath(const std::string &s1, const std::string &s2)
Definition: include_gunit.h:65

◆ MakeTmpdir()

static void file::MakeTmpdir ( )
inlinestatic

Definition at line 38 of file include_gunit.h.

38  {
39 #if defined(_WIN32)
40  _mkdir(FLAGS_test_tmpdir);
41 #else
42  mkdir(FLAGS_test_tmpdir, S_IRWXU | S_IRWXG);
43 #endif
44  }

◆ SetContents()

static bool file::SetContents ( const std::string &  name,
const std::string &  contents,
bool   
)
inlinestatic

Definition at line 56 of file include_gunit.h.

57  {
58  return WriteStringToFile(contents, name);
59  }
static bool WriteStringToFile(const std::string &contents, const std::string &filename)
Definition: include_gunit.h:47

◆ WriteStringToFile()

static bool file::WriteStringToFile ( const std::string &  contents,
const std::string &  filename 
)
inlinestatic

Definition at line 47 of file include_gunit.h.

47  {
48  File::WriteStringToFileOrDie(contents, filename);
49  return true;
50  }

The documentation for this class was generated from the following file: