TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
fmt::File Class Reference

#include <posix.h>

Classes

struct  Proxy
 

Public Types

enum  { RDONLY = FMT_POSIX(O_RDONLY), WRONLY = FMT_POSIX(O_WRONLY), RDWR = FMT_POSIX(O_RDWR) }
 

Public Member Functions

 File () FMT_NOEXCEPT
 
 File (CStringRef path, int oflag)
 
 File (Proxy p) FMT_NOEXCEPT
 
 File (File &other) FMT_NOEXCEPT
 
Fileoperator= (Proxy p)
 
Fileoperator= (File &other)
 
 operator Proxy () FMT_NOEXCEPT
 
 ~File () FMT_NOEXCEPT
 
int descriptor () const FMT_NOEXCEPT
 
void close ()
 
LongLong size () const
 
std::size_t read (void *buffer, std::size_t count)
 
std::size_t write (const void *buffer, std::size_t count)
 
void dup2 (int fd)
 
void dup2 (int fd, ErrorCode &ec) FMT_NOEXCEPT
 
BufferedFile fdopen (const char *mode)
 

Static Public Member Functions

static File dup (int fd)
 
static void pipe (File &read_end, File &write_end)
 

Private Member Functions

 File (int fd)
 

Private Attributes

int fd_
 

Member Enumeration Documentation

anonymous enum
Enumerator
RDONLY 
WRONLY 
RDWR 
227  {
228  RDONLY = FMT_POSIX(O_RDONLY), // Open for reading only.
229  WRONLY = FMT_POSIX(O_WRONLY), // Open for writing only.
230  RDWR = FMT_POSIX(O_RDWR) // Open for reading and writing.
231  };
Definition: posix.h:230
#define FMT_POSIX(call)
Definition: posix.h:55
Definition: posix.h:228
Definition: posix.h:229

Constructor & Destructor Documentation

fmt::File::File ( int  fd)
inlineexplicitprivate
223 : fd_(fd) {}
int fd_
Definition: posix.h:220
fmt::File::File ( )
inline
234 : fd_(-1) {}
int fd_
Definition: posix.h:220
fmt::File::File ( CStringRef  path,
int  oflag 
)
fmt::File::File ( Proxy  p)
inline
252 : fd_(p.fd) {}
int fd_
Definition: posix.h:220
fmt::File::File ( File other)
inline
255  : fd_(other.fd_) {
256  other.fd_ = -1;
257  }
int fd_
Definition: posix.h:220
fmt::File::~File ( )

Member Function Documentation

void fmt::File::close ( )

+ Here is the caller graph for this function:

int fmt::File::descriptor ( ) const
inline
303 { return fd_; }
int fd_
Definition: posix.h:220
static File fmt::File::dup ( int  fd)
static
void fmt::File::dup2 ( int  fd)
void fmt::File::dup2 ( int  fd,
ErrorCode ec 
)
BufferedFile fmt::File::fdopen ( const char *  mode)
fmt::File::operator Proxy ( )
inline
276  {
277  Proxy p = {fd_};
278  fd_ = -1;
279  return p;
280  }
int fd_
Definition: posix.h:220
File& fmt::File::operator= ( Proxy  p)
inline
260  {
261  close();
262  fd_ = p.fd;
263  return *this;
264  }
void close()
int fd_
Definition: posix.h:220

+ Here is the call graph for this function:

File& fmt::File::operator= ( File other)
inline
267  {
268  close();
269  fd_ = other.fd_;
270  other.fd_ = -1;
271  return *this;
272  }
void close()
int fd_
Definition: posix.h:220

+ Here is the call graph for this function:

static void fmt::File::pipe ( File read_end,
File write_end 
)
static
std::size_t fmt::File::read ( void *  buffer,
std::size_t  count 
)
LongLong fmt::File::size ( ) const
std::size_t fmt::File::write ( const void *  buffer,
std::size_t  count 
)

Member Data Documentation

int fmt::File::fd_
private

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