1 // Copyright (c) 2012 The WebM project authors. All Rights Reserved.
3 // Use of this source code is governed by a BSD-style license
4 // that can be found in the LICENSE file in the root of the source
5 // tree. An additional intellectual property rights grant can be found
6 // in the file PATENTS. All contributing project authors may
7 // be found in the AUTHORS file in the root of the source tree.
9 #include "./vttreader.h" // NOLINT
12 // Disable MSVC warnings that suggest making code non-portable.
13 #pragma warning(disable:4996)
18 VttReader::VttReader() : file_(NULL) {
21 VttReader::~VttReader() {
25 int VttReader::Open(const char* filename) {
26 if (filename == NULL || file_ != NULL)
29 file_ = fopen(filename, "rb");
36 void VttReader::Close() {
43 int VttReader::GetChar(char* c) {
44 if (c == NULL || file_ == NULL)
47 const int result = fgetc(file_);
49 *c = static_cast<char>(result);
62 } // namespace libwebvtt