Electroneum
testing::internal::posix Namespace Reference

Typedefs

typedef struct stat StatStruct
 

Functions

int FileNo (FILE *file)
 
int IsATTY (int fd)
 
int Stat (const char *path, StatStruct *buf)
 
int StrCaseCmp (const char *s1, const char *s2)
 
char * StrDup (const char *src)
 
int RmDir (const char *dir)
 
bool IsDir (const StatStruct &st)
 
const char * StrNCpy (char *dest, const char *src, size_t n)
 
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 2338 of file gtest-port.h.

Function Documentation

◆ Abort()

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

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

2410 { abort(); }

◆ ChDir()

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

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

2365 { return chdir(dir); }

◆ Close()

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

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

2384 { return close(fd); }

◆ FClose()

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

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

2376 { return fclose(fp); }

◆ FDOpen()

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

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

2374 { return fdopen(fd, mode); }

◆ FileNo()

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

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

2340 { return fileno(file); }

◆ FOpen()

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

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

2367  {
2368  return fopen(path, mode);
2369 }

◆ FReopen()

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

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

2371  {
2372  return freopen(path, mode, stream);
2373 }

◆ GetEnv()

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

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

2387  {
2388 #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE | GTEST_OS_WINDOWS_RT
2389  // We are on Windows CE, which has no environment variables.
2390  static_cast<void>(name); // To prevent 'unused argument' warning.
2391  return NULL;
2392 #elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
2393  // Environment variables which we programmatically clear will be set to the
2394  // empty string rather than unset (NULL). Handle that case.
2395  const char* const env = getenv(name);
2396  return (env != NULL && env[0] != '\0') ? env : NULL;
2397 #else
2398  return getenv(name);
2399 #endif
2400 }
const char * name

◆ IsATTY()

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

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

2341 { return isatty(fd); }

◆ IsDir()

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

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

2348 { return S_ISDIR(st.st_mode); }

◆ Read()

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

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

2378  {
2379  return static_cast<int>(read(fd, buf, count));
2380 }
mdb_size_t count(MDB_cursor *cur)
const char * buf
Definition: slow_memmem.cpp:74
Here is the call graph for this function:

◆ RmDir()

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

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

2347 { return rmdir(dir); }

◆ Stat()

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

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

2342 { return stat(path, buf); }
const char * buf
Definition: slow_memmem.cpp:74

◆ StrCaseCmp()

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

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

2343  {
2344  return strcasecmp(s1, s2);
2345 }

◆ StrDup()

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

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

2346 { return strdup(src); }

◆ StrError()

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

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

2385 { return strerror(errnum); }

◆ StrNCpy()

const char * testing::internal::posix::StrNCpy ( char *  dest,
const char *  src,
size_t  n 
)
inline

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

2356  {
2357  return strncpy(dest, src, n);
2358 }
CXA_THROW_INFO_T void(* dest)(void *))
Definition: stack_trace.cpp:91

◆ Write()

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

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

2381  {
2382  return static_cast<int>(write(fd, buf, count));
2383 }
mdb_size_t count(MDB_cursor *cur)
const char * buf
Definition: slow_memmem.cpp:74
Here is the call graph for this function: