Reformatted file_* classes.

BUG=
TEST=Trybots.

Review URL: https://webrtc-codereview.appspot.com/980004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3268 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
phoglund@webrtc.org
2012-12-12 12:52:15 +00:00
parent 4e16f25774
commit 740be44af5
3 changed files with 261 additions and 300 deletions

View File

@ -11,56 +11,54 @@
#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_FILE_IMPL_H_
#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_FILE_IMPL_H_
#include "system_wrappers/interface/file_wrapper.h"
#include <stdio.h>
#include "system_wrappers/interface/scoped_ptr.h"
#include "webrtc/system_wrappers/interface/file_wrapper.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
namespace webrtc {
class RWLockWrapper;
class FileWrapperImpl : public FileWrapper
{
public:
FileWrapperImpl();
virtual ~FileWrapperImpl();
class FileWrapperImpl : public FileWrapper {
public:
FileWrapperImpl();
virtual ~FileWrapperImpl();
virtual int FileName(char* fileNameUTF8,
size_t size) const;
virtual int FileName(char* file_name_utf8,
size_t size) const;
virtual bool Open() const;
virtual bool Open() const;
virtual int OpenFile(const char* fileNameUTF8,
bool readOnly,
bool loop = false,
bool text = false);
virtual int OpenFile(const char* file_name_utf8,
bool read_only,
bool loop = false,
bool text = false);
virtual int CloseFile();
virtual int SetMaxFileSize(size_t bytes);
virtual int Flush();
virtual int CloseFile();
virtual int SetMaxFileSize(size_t bytes);
virtual int Flush();
virtual int Read(void* buf, int length);
virtual bool Write(const void *buf, int length);
virtual int WriteText(const char* format, ...);
virtual int Rewind();
virtual int Read(void* buf, int length);
virtual bool Write(const void* buf, int length);
virtual int WriteText(const char* format, ...);
virtual int Rewind();
private:
int CloseFileImpl();
int FlushImpl();
private:
int CloseFileImpl();
int FlushImpl();
scoped_ptr<RWLockWrapper> _rwLock;
scoped_ptr<RWLockWrapper> rw_lock_;
FILE* _id;
bool _open;
bool _looping;
bool _readOnly;
size_t _maxSizeInBytes; // -1 indicates file size limitation is off
size_t _sizeInBytes;
char _fileNameUTF8[kMaxFileNameSize];
FILE* id_;
bool open_;
bool looping_;
bool read_only_;
size_t max_size_in_bytes_; // -1 indicates file size limitation is off
size_t size_in_bytes_;
char file_name_utf8_[kMaxFileNameSize];
};
} // namespace webrtc
#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_FILE_IMPL_H_
#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_FILE_IMPL_H_