andrew@webrtc.org 5ae19de3ec Fix error in RtpDump::Start due to r1156.
- r1156 fixed a check on the _text member of FileWrapper. Turns out this
  was incompatibile with the RTP dumps, which want to write both binary
  and text data. Writing text data to a file open as "b" isn't actually
  an error, so I simply removed the check.
- Also cleans up the interface, most notably removing all WebRtc types.

TEST=vie_auto_test

Review URL: http://webrtc-codereview.appspot.com/317005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1175 4adac7df-926f-26a2-2b94-8c16560cd09d
2011-12-13 22:59:33 +00:00

58 lines
1.5 KiB
C++

/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_FILE_IMPL_H_
#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_FILE_IMPL_H_
#include "file_wrapper.h"
#include <stdio.h>
namespace webrtc {
class FileWrapperImpl : public FileWrapper
{
public:
FileWrapperImpl();
virtual ~FileWrapperImpl();
virtual int FileName(char* fileNameUTF8,
size_t size) const;
virtual bool Open() const;
virtual int OpenFile(const char* fileNameUTF8,
bool readOnly,
bool loop = false,
bool text = false);
virtual int CloseFile();
virtual int SetMaxFileSize(size_t bytes);
virtual int Flush();
virtual int Read(void* buf, int len);
virtual bool Write(const void *buf, int len);
virtual int WriteText(const char* format, ...);
virtual int Rewind();
private:
FILE* _id;
bool _open;
bool _looping;
bool _readOnly;
size_t _maxSizeInBytes; // -1 indicates file size limitation is off
size_t _sizeInBytes;
char _fileNameUTF8[kMaxFileNameSize];
};
} // namespace webrtc
#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_FILE_IMPL_H_