chromium/third_party/protobuf/src/google/protobuf/stubs/time.cc

#include <google/protobuf/stubs/time.h>

#include <ctime>

#include <google/protobuf/stubs/stringprintf.h>
#include <google/protobuf/stubs/strutil.h>

namespace google {
namespace protobuf {
namespace internal {

namespace {
static const int64_t kSecondsPerMinute =;
static const int64_t kSecondsPerHour =;
static const int64_t kSecondsPerDay =;
static const int64_t kSecondsPer400Years =;
// Seconds from 0001-01-01T00:00:00 to 1970-01-01T:00:00:00
static const int64_t kSecondsFromEraToEpoch =;
// The range of timestamp values we support.
static const int64_t kMinTime =;  // 0001-01-01T00:00:00
static const int64_t kMaxTime =;  // 9999-12-31T23:59:59

static const int kNanosPerMillisecond =;
static const int kNanosPerMicrosecond =;

// Count the seconds from the given year (start at Jan 1, 00:00) to 100 years
// after.
int64_t SecondsPer100Years(int year) {}

// Count the seconds from the given year (start at Jan 1, 00:00) to 4 years
// after.
int64_t SecondsPer4Years(int year) {}

bool IsLeapYear(int year) {}

int64_t SecondsPerYear(int year) {}

static const int kDaysInMonth[13] =;

int64_t SecondsPerMonth(int month, bool leap) {}

static const int kDaysSinceJan[13] =;

bool ValidateDateTime(const DateTime& time) {}

// Count the number of seconds elapsed from 0001-01-01T00:00:00 to the given
// time.
int64_t SecondsSinceCommonEra(const DateTime& time) {}

// Format nanoseconds with either 3, 6, or 9 digits depending on the required
// precision to represent the exact value.
std::string FormatNanos(int32_t nanos) {}

// Parses an integer from a null-terminated char sequence. The method
// consumes at most "width" chars. Returns a pointer after the consumed
// integer, or nullptr if the data does not start with an integer or the
// integer value does not fall in the range of [min_value, max_value].
const char* ParseInt(const char* data, int width, int min_value,
                     int max_value, int* result) {}

// Consumes the fractional parts of a second into nanos. For example,
// "010" will be parsed to 10000000 nanos.
const char* ParseNanos(const char* data, int32_t* nanos) {}

const char* ParseTimezoneOffset(const char* data, int64_t* offset) {}
}  // namespace

bool SecondsToDateTime(int64_t seconds, DateTime* time) {}

bool DateTimeToSeconds(const DateTime& time, int64_t* seconds) {}

void GetCurrentTime(int64_t* seconds, int32_t* nanos) {}

std::string FormatTime(int64_t seconds, int32_t nanos) {}

bool ParseTime(const std::string& value, int64_t* seconds, int32_t* nanos) {}

}  // namespace internal
}  // namespace protobuf
}  // namespace google