Export of internal Abseil changes
-- ea0cfebeb69b25bec343652bbe1a203f5476c51a by Mark Barolak <mbar@google.com>: Change "std::string" to "string" in places where a "std::" qualification was incorrectly inserted by automation. PiperOrigin-RevId: 300108520 GitOrigin-RevId: ea0cfebeb69b25bec343652bbe1a203f5476c51a Change-Id: Ie3621e63a6ebad67b9fe56a3ebe33e1d50dac602
This commit is contained in:
parent
d936052d32
commit
a877af1f29
68 changed files with 191 additions and 191 deletions
|
|
@ -38,7 +38,7 @@ std::string FormatYearAnd(string_view fmt, CivilSecond cs) {
|
|||
const CivilSecond ncs(NormalizeYear(cs.year()), cs.month(), cs.day(),
|
||||
cs.hour(), cs.minute(), cs.second());
|
||||
const TimeZone utc = UTCTimeZone();
|
||||
// TODO(absl-team): Avoid conversion of fmt std::string.
|
||||
// TODO(absl-team): Avoid conversion of fmt string.
|
||||
return StrCat(cs.year(),
|
||||
FormatTime(std::string(fmt), FromCivil(ncs, utc), utc));
|
||||
}
|
||||
|
|
@ -47,7 +47,7 @@ template <typename CivilT>
|
|||
bool ParseYearAnd(string_view fmt, string_view s, CivilT* c) {
|
||||
// Civil times support a larger year range than absl::Time, so we need to
|
||||
// parse the year separately, normalize it, then use absl::ParseTime on the
|
||||
// normalized std::string.
|
||||
// normalized string.
|
||||
const std::string ss = std::string(s); // TODO(absl-team): Avoid conversion.
|
||||
const char* const np = ss.c_str();
|
||||
char* endp;
|
||||
|
|
@ -82,7 +82,7 @@ bool ParseAs(string_view s, CivilT2* c) {
|
|||
|
||||
template <typename CivilT>
|
||||
bool ParseLenient(string_view s, CivilT* c) {
|
||||
// A fastpath for when the given std::string data parses exactly into the given
|
||||
// A fastpath for when the given string data parses exactly into the given
|
||||
// type T (e.g., s="YYYY-MM-DD" and CivilT=CivilDay).
|
||||
if (ParseCivilTime(s, c)) return true;
|
||||
// Try parsing as each of the 6 types, trying the most common types first
|
||||
|
|
|
|||
|
|
@ -874,12 +874,12 @@ bool ParseDuration(const std::string& dur_string, Duration* d) {
|
|||
++start;
|
||||
}
|
||||
|
||||
// Can't parse a duration from an empty std::string.
|
||||
// Can't parse a duration from an empty string.
|
||||
if (*start == '\0') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Special case for a std::string of "0".
|
||||
// Special case for a string of "0".
|
||||
if (*start == '0' && *(start + 1) == '\0') {
|
||||
*d = ZeroDuration();
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ TEST(ParseTime, WithTimeZone) {
|
|||
absl::Time t;
|
||||
std::string e;
|
||||
|
||||
// We can parse a std::string without a UTC offset if we supply a timezone.
|
||||
// We can parse a string without a UTC offset if we supply a timezone.
|
||||
EXPECT_TRUE(
|
||||
absl::ParseTime("%Y-%m-%d %H:%M:%S", "2013-06-28 19:08:09", tz, &t, &e))
|
||||
<< e;
|
||||
|
|
@ -327,7 +327,7 @@ TEST(ParseTime, InfiniteTime) {
|
|||
EXPECT_TRUE(absl::ParseTime("%H:%M blah", " infinite-past ", &t, &err));
|
||||
EXPECT_EQ(absl::InfinitePast(), t);
|
||||
|
||||
// "infinite-future" as literal std::string
|
||||
// "infinite-future" as literal string
|
||||
absl::TimeZone tz = absl::UTCTimeZone();
|
||||
EXPECT_TRUE(absl::ParseTime("infinite-future %H:%M", "infinite-future 03:04",
|
||||
&t, &err));
|
||||
|
|
@ -335,7 +335,7 @@ TEST(ParseTime, InfiniteTime) {
|
|||
EXPECT_EQ(3, tz.At(t).cs.hour());
|
||||
EXPECT_EQ(4, tz.At(t).cs.minute());
|
||||
|
||||
// "infinite-past" as literal std::string
|
||||
// "infinite-past" as literal string
|
||||
EXPECT_TRUE(
|
||||
absl::ParseTime("infinite-past %H:%M", "infinite-past 03:04", &t, &err));
|
||||
EXPECT_NE(absl::InfinitePast(), t);
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ class time_zone {
|
|||
// version() and description() provide additional information about the
|
||||
// time zone. The content of each of the returned strings is unspecified,
|
||||
// however, when the IANA Time Zone Database is the underlying data source
|
||||
// the version() std::string will be in the familar form (e.g, "2018e") or
|
||||
// the version() string will be in the familar form (e.g, "2018e") or
|
||||
// empty when unavailable.
|
||||
//
|
||||
// Note: These functions are for informational or testing purposes only.
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class ZoneInfoSource {
|
|||
|
||||
// Until the zoneinfo data supports versioning information, we provide
|
||||
// a way for a ZoneInfoSource to indicate it out-of-band. The default
|
||||
// implementation returns an empty std::string.
|
||||
// implementation returns an empty string.
|
||||
virtual std::string Version() const;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ void FormatTM(std::string* out, const std::string& fmt, const std::tm& tm) {
|
|||
// strftime(3) returns the number of characters placed in the output
|
||||
// array (which may be 0 characters). It also returns 0 to indicate
|
||||
// an error, like the array wasn't large enough. To accommodate this,
|
||||
// the following code grows the buffer size from 2x the format std::string
|
||||
// the following code grows the buffer size from 2x the format string
|
||||
// length up to 32x.
|
||||
for (std::size_t i = 2; i != 32; i *= 2) {
|
||||
std::size_t buf_size = fmt.size() * i;
|
||||
|
|
@ -839,7 +839,7 @@ bool parse(const std::string& format, const std::string& input,
|
|||
// Skip any remaining whitespace.
|
||||
while (std::isspace(*data)) ++data;
|
||||
|
||||
// parse() must consume the entire input std::string.
|
||||
// parse() must consume the entire input string.
|
||||
if (*data != '\0') {
|
||||
if (err != nullptr) *err = "Illegal trailing data in input string";
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -767,7 +767,7 @@ TEST(Parse, WithTimeZone) {
|
|||
EXPECT_TRUE(load_time_zone("America/Los_Angeles", &tz));
|
||||
time_point<chrono::nanoseconds> tp;
|
||||
|
||||
// We can parse a std::string without a UTC offset if we supply a timezone.
|
||||
// We can parse a string without a UTC offset if we supply a timezone.
|
||||
EXPECT_TRUE(parse("%Y-%m-%d %H:%M:%S", "2013-06-28 19:08:09", tz, &tp));
|
||||
ExpectTime(tp, tz, 2013, 6, 28, 19, 8, 9, -7 * 60 * 60, true, "PDT");
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class time_zone::Impl {
|
|||
return zone_->PrevTransition(tp, trans);
|
||||
}
|
||||
|
||||
// Returns an implementation-defined version std::string for this time zone.
|
||||
// Returns an implementation-defined version string for this time zone.
|
||||
std::string Version() const { return zone_->Version(); }
|
||||
|
||||
// Returns an implementation-defined description of this time zone.
|
||||
|
|
|
|||
|
|
@ -506,7 +506,7 @@ bool TimeZoneInfo::Load(const std::string& name, ZoneInfoSource* zip) {
|
|||
|
||||
// If we did not find version information during the standard loading
|
||||
// process (as of tzh_version '3' that is unsupported), then ask the
|
||||
// ZoneInfoSource for any out-of-bound version std::string it may be privy to.
|
||||
// ZoneInfoSource for any out-of-bound version string it may be privy to.
|
||||
if (version_.empty()) {
|
||||
version_ = zip->Version();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -749,7 +749,7 @@ TEST(TimeZone, Failures) {
|
|||
EXPECT_EQ(chrono::system_clock::from_time_t(0),
|
||||
convert(civil_second(1970, 1, 1, 0, 0, 0), tz)); // UTC
|
||||
|
||||
// Loading an empty std::string timezone should fail.
|
||||
// Loading an empty string timezone should fail.
|
||||
tz = LoadZone("America/Los_Angeles");
|
||||
EXPECT_FALSE(load_time_zone("", &tz));
|
||||
EXPECT_EQ(chrono::system_clock::from_time_t(0),
|
||||
|
|
|
|||
|
|
@ -83,13 +83,13 @@ struct tzhead {
|
|||
** If tzh_version is '2' or greater, the above is followed by a second instance
|
||||
** of tzhead and a second instance of the data in which each coded transition
|
||||
** time uses 8 rather than 4 chars,
|
||||
** then a POSIX-TZ-environment-variable-style std::string for use in handling
|
||||
** then a POSIX-TZ-environment-variable-style string for use in handling
|
||||
** instants after the last transition time stored in the file
|
||||
** (with nothing between the newlines if there is no POSIX representation for
|
||||
** such instants).
|
||||
**
|
||||
** If tz_version is '3' or greater, the above is extended as follows.
|
||||
** First, the POSIX TZ std::string's hour offset may range from -167
|
||||
** First, the POSIX TZ string's hour offset may range from -167
|
||||
** through 167 as compared to the POSIX-required 0 through 24.
|
||||
** Second, its DST start time may be January 1 at 00:00 and its stop
|
||||
** time December 31 at 24:00 plus the difference between DST and
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ TEST(TimeZone, Failures) {
|
|||
EXPECT_FALSE(LoadTimeZone("Invalid/TimeZone", &tz));
|
||||
EXPECT_EQ(absl::UTCTimeZone(), tz); // guaranteed fallback to UTC
|
||||
|
||||
// Loading an empty std::string timezone should fail.
|
||||
// Loading an empty string timezone should fail.
|
||||
tz = absl::time_internal::LoadTimeZone("America/Los_Angeles");
|
||||
EXPECT_FALSE(LoadTimeZone("", &tz));
|
||||
EXPECT_EQ(absl::UTCTimeZone(), tz); // guaranteed fallback to UTC
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue