Xmipp  v3.23.11-Nereus
Typedefs | Functions
testing::internal::posix Namespace Reference

Typedefs

typedef struct stat StatStruct
 

Functions

int FileNo (FILE *file)
 
int Stat (const char *path, StatStruct *buf)
 
int RmDir (const char *dir)
 
bool IsDir (const StatStruct &st)
 
int DoIsATTY (int fd)
 
int StrCaseCmp (const char *s1, const char *s2)
 
char * StrDup (const char *src)
 
int IsATTY (int fd)
 
int ChDir (const char *dir)
 
FILE * FOpen (const char *path, const char *mode)
 
FILE * FReopen (const char *path, const char *mode, FILE *stream)
 
FILE * FDOpen (int fd, const char *mode)
 
int FClose (FILE *fp)
 
int Read (int fd, void *buf, unsigned int count)
 
int Write (int fd, const void *buf, unsigned int count)
 
int Close (int fd)
 
const char * StrError (int errnum)
 
const char * GetEnv (const char *name)
 
void Abort ()
 

Typedef Documentation

◆ StatStruct

Definition at line 2011 of file gtest-port.h.

Function Documentation

◆ Abort()

void testing::internal::posix::Abort ( )
inline

Definition at line 2149 of file gtest-port.h.

2149 { abort(); }

◆ ChDir()

int testing::internal::posix::ChDir ( const char *  dir)
inline

Definition at line 2089 of file gtest-port.h.

2089 { return chdir(dir); }

◆ Close()

int testing::internal::posix::Close ( int  fd)
inline

Definition at line 2116 of file gtest-port.h.

2116 { return close(fd); }

◆ DoIsATTY()

int testing::internal::posix::DoIsATTY ( int  fd)
inline

Definition at line 2059 of file gtest-port.h.

2059 { return isatty(fd); }

◆ FClose()

int testing::internal::posix::FClose ( FILE *  fp)
inline

Definition at line 2108 of file gtest-port.h.

2108 { return fclose(fp); }

◆ FDOpen()

FILE* testing::internal::posix::FDOpen ( int  fd,
const char *  mode 
)
inline

Definition at line 2106 of file gtest-port.h.

2106 { return fdopen(fd, mode); }
void mode

◆ FileNo()

int testing::internal::posix::FileNo ( FILE *  file)
inline

Definition at line 2013 of file gtest-port.h.

2013 { return fileno(file); }

◆ FOpen()

FILE* testing::internal::posix::FOpen ( const char *  path,
const char *  mode 
)
inline

Definition at line 2091 of file gtest-port.h.

2091  {
2092 #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MINGW
2093  struct wchar_codecvt : public std::codecvt<wchar_t, char, std::mbstate_t> {};
2094  std::wstring_convert<wchar_codecvt> converter;
2095  std::wstring wide_path = converter.from_bytes(path);
2096  std::wstring wide_mode = converter.from_bytes(mode);
2097  return _wfopen(wide_path.c_str(), wide_mode.c_str());
2098 #else // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MINGW
2099  return fopen(path, mode);
2100 #endif // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MINGW
2101 }
void mode

◆ FReopen()

FILE* testing::internal::posix::FReopen ( const char *  path,
const char *  mode,
FILE *  stream 
)
inline

Definition at line 2103 of file gtest-port.h.

2103  {
2104  return freopen(path, mode, stream);
2105 }
void mode

◆ GetEnv()

const char* testing::internal::posix::GetEnv ( const char *  name)
inline

Definition at line 2124 of file gtest-port.h.

2124  {
2125 #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || \
2126  GTEST_OS_WINDOWS_RT || GTEST_OS_ESP8266 || GTEST_OS_XTENSA || \
2127  GTEST_OS_QURT
2128  // We are on an embedded platform, which has no environment variables.
2129  static_cast<void>(name); // To prevent 'unused argument' warning.
2130  return nullptr;
2131 #elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
2132  // Environment variables which we programmatically clear will be set to the
2133  // empty string rather than unset (NULL). Handle that case.
2134  const char* const env = getenv(name);
2135  return (env != nullptr && env[0] != '\0') ? env : nullptr;
2136 #else
2137  return getenv(name);
2138 #endif
2139 }

◆ IsATTY()

int testing::internal::posix::IsATTY ( int  fd)
inline

Definition at line 2067 of file gtest-port.h.

2067  {
2068  // DoIsATTY might change errno (for example ENOTTY in case you redirect stdout
2069  // to a file on Linux), which is unexpected, so save the previous value, and
2070  // restore it after the call.
2071  int savedErrno = errno;
2072  int isAttyValue = DoIsATTY(fd);
2073  errno = savedErrno;
2074 
2075  return isAttyValue;
2076 }

◆ IsDir()

bool testing::internal::posix::IsDir ( const StatStruct st)
inline

Definition at line 2021 of file gtest-port.h.

2021 { return S_ISDIR(st.st_mode); }

◆ Read()

int testing::internal::posix::Read ( int  fd,
void *  buf,
unsigned int  count 
)
inline

Definition at line 2110 of file gtest-port.h.

2110  {
2111  return static_cast<int>(read(fd, buf, count));
2112 }
file read(std::istream &is)
Definition: pdb2cif.cpp:6200

◆ RmDir()

int testing::internal::posix::RmDir ( const char *  dir)
inline

Definition at line 2019 of file gtest-port.h.

2019 { return rmdir(dir); }

◆ Stat()

int testing::internal::posix::Stat ( const char *  path,
StatStruct buf 
)
inline

Definition at line 2014 of file gtest-port.h.

2014 { return stat(path, buf); }

◆ StrCaseCmp()

int testing::internal::posix::StrCaseCmp ( const char *  s1,
const char *  s2 
)
inline

Definition at line 2060 of file gtest-port.h.

2060  {
2061  return strcasecmp(s1, s2);
2062 }

◆ StrDup()

char* testing::internal::posix::StrDup ( const char *  src)
inline

Definition at line 2063 of file gtest-port.h.

2063 { return strdup(src); }

◆ StrError()

const char* testing::internal::posix::StrError ( int  errnum)
inline

Definition at line 2121 of file gtest-port.h.

2121 { return strerror(errnum); }

◆ Write()

int testing::internal::posix::Write ( int  fd,
const void *  buf,
unsigned int  count 
)
inline

Definition at line 2113 of file gtest-port.h.

2113  {
2114  return static_cast<int>(write(fd, buf, count));
2115 }
void write(std::ostream &os, const datablock &db)
Definition: cif2pdb.cpp:3747