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
13 VttReader::VttReader() : file_(NULL) {
16 VttReader::~VttReader() {
20 int VttReader::Open(const char* filename) {
21 if (filename == NULL || file_ != NULL)
24 file_ = fopen(filename, "rb");
31 void VttReader::Close() {
38 int VttReader::GetChar(char* c) {
39 if (c == NULL || file_ == NULL)
42 const int result = fgetc(file_);
44 *c = static_cast<char>(result);
57 } // namespace libwebvtt