Fully qualifiying usage of std::string

Replacing "using std::string" with fully qualified namespace on
each occurance of string in sample_muxer_metadata.cc and
webvttparser.cc.

Also fixing a formatting nit in mkvwriteeofreader.cpp

Change-Id: Icf713f9e489fbdc9af14e83d0cb7ba2e89e65ab4
This commit is contained in:
Vignesh Venkatasubramanian
2013-06-12 11:23:35 -07:00
parent 54ca052b1c
commit 09dd90fcc7
3 changed files with 31 additions and 35 deletions

View File

@@ -2,8 +2,6 @@
#include <string>
#include "vttreader.h"
using std::string;
SampleMuxerMetadata::SampleMuxerMetadata() : segment_(NULL) {
}
@@ -295,7 +293,7 @@ bool SampleMuxerMetadata::Parse(
}
}
void SampleMuxerMetadata::MakeFrame(const cue_t& c, string* pf) {
void SampleMuxerMetadata::MakeFrame(const cue_t& c, std::string* pf) {
pf->clear();
WriteCueIdentifier(c.identifier, pf);
WriteCueSettings(c.settings, pf);
@@ -303,15 +301,15 @@ void SampleMuxerMetadata::MakeFrame(const cue_t& c, string* pf) {
}
void SampleMuxerMetadata::WriteCueIdentifier(
const string& identifier,
string* pf) {
const std::string& identifier,
std::string* pf) {
pf->append(identifier);
pf->push_back('\x0A'); // LF
}
void SampleMuxerMetadata::WriteCueSettings(
const cue_t::settings_t& settings,
string* pf) {
std::string* pf) {
if (settings.empty()) {
pf->push_back('\x0A'); // LF
return;
@@ -340,14 +338,14 @@ void SampleMuxerMetadata::WriteCueSettings(
void SampleMuxerMetadata::WriteCuePayload(
const cue_t::payload_t& payload,
string* pf) {
std::string* pf) {
typedef cue_t::payload_t::const_iterator iter_t;
iter_t i = payload.begin();
const iter_t j = payload.end();
while (i != j) {
const string& line = *i++;
const std::string& line = *i++;
pf->append(line);
pf->push_back('\x0A'); // LF
}
@@ -370,7 +368,7 @@ bool SampleMuxerMetadata::SortableCue::Write(
// Metadata blocks always specify the block duration.
const mkvmuxer::int64 duration_ns = stop_ns - start_ns;
string frame;
std::string frame;
MakeFrame(cue, &frame);
typedef const mkvmuxer::uint8* data_t;

View File

@@ -9,8 +9,6 @@
#include "./webvttparser.h" // NOLINT
#include <climits>
using std::string;
namespace libwebvtt {
enum {
@@ -27,11 +25,11 @@ Reader::~Reader() {
LineReader::~LineReader() {
}
int LineReader::GetLine(string* line_ptr) {
int LineReader::GetLine(std::string* line_ptr) {
if (line_ptr == NULL)
return -1;
string& ln = *line_ptr;
std::string& ln = *line_ptr;
ln.clear();
// Consume characters from the stream, until we
@@ -138,7 +136,7 @@ int Parser::Init() {
return -1;
}
string line;
std::string line;
e = GetLine(&line);
@@ -181,7 +179,7 @@ int Parser::Parse(Cue* cue) {
// Parse first non-blank line
string line;
std::string line;
int e;
for (;;) {
@@ -200,9 +198,9 @@ int Parser::Parse(Cue* cue) {
// may not appear in the cue identifier line.
const char kArrow[] = "-->";
string::size_type arrow_pos = line.find(kArrow);
std::string::size_type arrow_pos = line.find(kArrow);
if (arrow_pos != string::npos) {
if (arrow_pos != std::string::npos) {
// We found a timings line, which implies that we don't have a cue
// identifier.
@@ -224,7 +222,7 @@ int Parser::Parse(Cue* cue) {
arrow_pos = line.find(kArrow);
if (arrow_pos == string::npos) // not a timings line
if (arrow_pos == std::string::npos) // not a timings line
return -1;
}
@@ -306,23 +304,23 @@ int Parser::ParseBOM() {
}
int Parser::ParseTimingsLine(
string* line_ptr,
string::size_type arrow_pos,
std::string* line_ptr,
std::string::size_type arrow_pos,
Time* start_time,
Time* stop_time,
Cue::settings_t* settings) {
if (line_ptr == NULL)
return -1;
string& line = *line_ptr;
std::string& line = *line_ptr;
if (arrow_pos == string::npos || arrow_pos >= line.length())
if (arrow_pos == std::string::npos || arrow_pos >= line.length())
return -1;
// Place a NUL character at the start of the arrow token, in
// order to demarcate the start time from remainder of line.
line[arrow_pos] = kNUL;
string::size_type idx = 0;
std::string::size_type idx = 0;
int e = ParseTime(line, &idx, start_time);
if (e) // error
@@ -356,15 +354,15 @@ int Parser::ParseTimingsLine(
}
int Parser::ParseTime(
const string& line,
string::size_type* idx_ptr,
const std::string& line,
std::string::size_type* idx_ptr,
Time* time) {
if (idx_ptr == NULL)
return -1;
string::size_type& idx = *idx_ptr;
std::string::size_type& idx = *idx_ptr;
if (idx == string::npos || idx >= line.length())
if (idx == std::string::npos || idx >= line.length())
return -1;
if (time == NULL)
@@ -514,12 +512,12 @@ int Parser::ParseTime(
}
int Parser::ParseSettings(
const string& line,
string::size_type idx,
const std::string& line,
std::string::size_type idx,
Cue::settings_t* settings) {
settings->clear();
if (idx == string::npos || idx >= line.length())
if (idx == std::string::npos || idx >= line.length())
return -1;
for (;;) {
@@ -588,14 +586,14 @@ int Parser::ParseSettings(
}
int Parser::ParseNumber(
const string& line,
string::size_type* idx_ptr) {
const std::string& line,
std::string::size_type* idx_ptr) {
if (idx_ptr == NULL)
return -1;
string::size_type& idx = *idx_ptr;
std::string::size_type& idx = *idx_ptr;
if (idx == string::npos || idx >= line.length())
if (idx == std::string::npos || idx >= line.length())
return -1;
if (!isdigit(line[idx]))