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:
@@ -2,8 +2,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include "vttreader.h"
|
#include "vttreader.h"
|
||||||
|
|
||||||
using std::string;
|
|
||||||
|
|
||||||
SampleMuxerMetadata::SampleMuxerMetadata() : segment_(NULL) {
|
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();
|
pf->clear();
|
||||||
WriteCueIdentifier(c.identifier, pf);
|
WriteCueIdentifier(c.identifier, pf);
|
||||||
WriteCueSettings(c.settings, pf);
|
WriteCueSettings(c.settings, pf);
|
||||||
@@ -303,15 +301,15 @@ void SampleMuxerMetadata::MakeFrame(const cue_t& c, string* pf) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SampleMuxerMetadata::WriteCueIdentifier(
|
void SampleMuxerMetadata::WriteCueIdentifier(
|
||||||
const string& identifier,
|
const std::string& identifier,
|
||||||
string* pf) {
|
std::string* pf) {
|
||||||
pf->append(identifier);
|
pf->append(identifier);
|
||||||
pf->push_back('\x0A'); // LF
|
pf->push_back('\x0A'); // LF
|
||||||
}
|
}
|
||||||
|
|
||||||
void SampleMuxerMetadata::WriteCueSettings(
|
void SampleMuxerMetadata::WriteCueSettings(
|
||||||
const cue_t::settings_t& settings,
|
const cue_t::settings_t& settings,
|
||||||
string* pf) {
|
std::string* pf) {
|
||||||
if (settings.empty()) {
|
if (settings.empty()) {
|
||||||
pf->push_back('\x0A'); // LF
|
pf->push_back('\x0A'); // LF
|
||||||
return;
|
return;
|
||||||
@@ -340,14 +338,14 @@ void SampleMuxerMetadata::WriteCueSettings(
|
|||||||
|
|
||||||
void SampleMuxerMetadata::WriteCuePayload(
|
void SampleMuxerMetadata::WriteCuePayload(
|
||||||
const cue_t::payload_t& payload,
|
const cue_t::payload_t& payload,
|
||||||
string* pf) {
|
std::string* pf) {
|
||||||
typedef cue_t::payload_t::const_iterator iter_t;
|
typedef cue_t::payload_t::const_iterator iter_t;
|
||||||
|
|
||||||
iter_t i = payload.begin();
|
iter_t i = payload.begin();
|
||||||
const iter_t j = payload.end();
|
const iter_t j = payload.end();
|
||||||
|
|
||||||
while (i != j) {
|
while (i != j) {
|
||||||
const string& line = *i++;
|
const std::string& line = *i++;
|
||||||
pf->append(line);
|
pf->append(line);
|
||||||
pf->push_back('\x0A'); // LF
|
pf->push_back('\x0A'); // LF
|
||||||
}
|
}
|
||||||
@@ -370,7 +368,7 @@ bool SampleMuxerMetadata::SortableCue::Write(
|
|||||||
// Metadata blocks always specify the block duration.
|
// Metadata blocks always specify the block duration.
|
||||||
const mkvmuxer::int64 duration_ns = stop_ns - start_ns;
|
const mkvmuxer::int64 duration_ns = stop_ns - start_ns;
|
||||||
|
|
||||||
string frame;
|
std::string frame;
|
||||||
MakeFrame(cue, &frame);
|
MakeFrame(cue, &frame);
|
||||||
|
|
||||||
typedef const mkvmuxer::uint8* data_t;
|
typedef const mkvmuxer::uint8* data_t;
|
||||||
|
|||||||
@@ -9,8 +9,6 @@
|
|||||||
#include "./webvttparser.h" // NOLINT
|
#include "./webvttparser.h" // NOLINT
|
||||||
#include <climits>
|
#include <climits>
|
||||||
|
|
||||||
using std::string;
|
|
||||||
|
|
||||||
namespace libwebvtt {
|
namespace libwebvtt {
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@@ -27,11 +25,11 @@ Reader::~Reader() {
|
|||||||
LineReader::~LineReader() {
|
LineReader::~LineReader() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int LineReader::GetLine(string* line_ptr) {
|
int LineReader::GetLine(std::string* line_ptr) {
|
||||||
if (line_ptr == NULL)
|
if (line_ptr == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
string& ln = *line_ptr;
|
std::string& ln = *line_ptr;
|
||||||
ln.clear();
|
ln.clear();
|
||||||
|
|
||||||
// Consume characters from the stream, until we
|
// Consume characters from the stream, until we
|
||||||
@@ -138,7 +136,7 @@ int Parser::Init() {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
string line;
|
std::string line;
|
||||||
|
|
||||||
e = GetLine(&line);
|
e = GetLine(&line);
|
||||||
|
|
||||||
@@ -181,7 +179,7 @@ int Parser::Parse(Cue* cue) {
|
|||||||
|
|
||||||
// Parse first non-blank line
|
// Parse first non-blank line
|
||||||
|
|
||||||
string line;
|
std::string line;
|
||||||
int e;
|
int e;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
@@ -200,9 +198,9 @@ int Parser::Parse(Cue* cue) {
|
|||||||
// may not appear in the cue identifier line.
|
// may not appear in the cue identifier line.
|
||||||
|
|
||||||
const char kArrow[] = "-->";
|
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
|
// We found a timings line, which implies that we don't have a cue
|
||||||
// identifier.
|
// identifier.
|
||||||
|
|
||||||
@@ -224,7 +222,7 @@ int Parser::Parse(Cue* cue) {
|
|||||||
|
|
||||||
arrow_pos = line.find(kArrow);
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -306,23 +304,23 @@ int Parser::ParseBOM() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Parser::ParseTimingsLine(
|
int Parser::ParseTimingsLine(
|
||||||
string* line_ptr,
|
std::string* line_ptr,
|
||||||
string::size_type arrow_pos,
|
std::string::size_type arrow_pos,
|
||||||
Time* start_time,
|
Time* start_time,
|
||||||
Time* stop_time,
|
Time* stop_time,
|
||||||
Cue::settings_t* settings) {
|
Cue::settings_t* settings) {
|
||||||
if (line_ptr == NULL)
|
if (line_ptr == NULL)
|
||||||
return -1;
|
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;
|
return -1;
|
||||||
|
|
||||||
// Place a NUL character at the start of the arrow token, in
|
// Place a NUL character at the start of the arrow token, in
|
||||||
// order to demarcate the start time from remainder of line.
|
// order to demarcate the start time from remainder of line.
|
||||||
line[arrow_pos] = kNUL;
|
line[arrow_pos] = kNUL;
|
||||||
string::size_type idx = 0;
|
std::string::size_type idx = 0;
|
||||||
|
|
||||||
int e = ParseTime(line, &idx, start_time);
|
int e = ParseTime(line, &idx, start_time);
|
||||||
if (e) // error
|
if (e) // error
|
||||||
@@ -356,15 +354,15 @@ int Parser::ParseTimingsLine(
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Parser::ParseTime(
|
int Parser::ParseTime(
|
||||||
const string& line,
|
const std::string& line,
|
||||||
string::size_type* idx_ptr,
|
std::string::size_type* idx_ptr,
|
||||||
Time* time) {
|
Time* time) {
|
||||||
if (idx_ptr == NULL)
|
if (idx_ptr == NULL)
|
||||||
return -1;
|
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;
|
return -1;
|
||||||
|
|
||||||
if (time == NULL)
|
if (time == NULL)
|
||||||
@@ -514,12 +512,12 @@ int Parser::ParseTime(
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Parser::ParseSettings(
|
int Parser::ParseSettings(
|
||||||
const string& line,
|
const std::string& line,
|
||||||
string::size_type idx,
|
std::string::size_type idx,
|
||||||
Cue::settings_t* settings) {
|
Cue::settings_t* settings) {
|
||||||
settings->clear();
|
settings->clear();
|
||||||
|
|
||||||
if (idx == string::npos || idx >= line.length())
|
if (idx == std::string::npos || idx >= line.length())
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
@@ -588,14 +586,14 @@ int Parser::ParseSettings(
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Parser::ParseNumber(
|
int Parser::ParseNumber(
|
||||||
const string& line,
|
const std::string& line,
|
||||||
string::size_type* idx_ptr) {
|
std::string::size_type* idx_ptr) {
|
||||||
if (idx_ptr == NULL)
|
if (idx_ptr == NULL)
|
||||||
return -1;
|
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;
|
return -1;
|
||||||
|
|
||||||
if (!isdigit(line[idx]))
|
if (!isdigit(line[idx]))
|
||||||
|
|||||||
Reference in New Issue
Block a user