chromium/third_party/blink/renderer/platform/text/platform_locale.cc

/*
 * Copyright (C) 2011,2012 Google Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 *     * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above
 * copyright notice, this list of conditions and the following disclaimer
 * in the documentation and/or other materials provided with the
 * distribution.
 *     * Neither the name of Google Inc. nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "third_party/blink/renderer/platform/text/platform_locale.h"

#include <memory>

#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/strings/grit/blink_strings.h"
#include "third_party/blink/renderer/platform/text/date_time_format.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
#include "third_party/blink/renderer/platform/wtf/wtf.h"

namespace blink {

namespace {
Locale* g_default_locale;
}

class DateTimeStringBuilder : private DateTimeFormat::TokenHandler {};

DateTimeStringBuilder::DateTimeStringBuilder(Locale& localizer,
                                             const DateComponents& date)
    :{}

bool DateTimeStringBuilder::Build(const String& format_string) {}

String DateTimeStringBuilder::ZeroPadString(const String& string,
                                            size_t pad_width) {}

void DateTimeStringBuilder::AppendNumber(int number, size_t width) {}

void DateTimeStringBuilder::VisitField(DateTimeFormat::FieldType field_type,
                                       int number_of_pattern_characters) {}

void DateTimeStringBuilder::VisitLiteral(const String& text) {}

String DateTimeStringBuilder::ToString() {}

Locale& Locale::DefaultLocale() {}

void Locale::ResetDefaultLocale() {}

Locale::~Locale() = default;

String Locale::QueryString(int resource_id) {}

String Locale::QueryString(int resource_id, const String& parameter) {}

String Locale::QueryString(int resource_id,
                           const String& parameter1,
                           const String& parameter2) {}

String Locale::ValidationMessageTooLongText(unsigned value_length,
                                            int max_length) {}

String Locale::ValidationMessageTooShortText(unsigned value_length,
                                             int min_length) {}

String Locale::WeekFormatInLDML() {}

void Locale::SetLocaleData(const Vector<String, kDecimalSymbolsSize>& symbols,
                           const String& positive_prefix,
                           const String& positive_suffix,
                           const String& negative_prefix,
                           const String& negative_suffix) {}

String Locale::ConvertToLocalizedNumber(const String& input) {}

static bool Matches(const String& text, unsigned position, const String& part) {}

bool Locale::DetectSignAndGetDigitRange(const String& input,
                                        bool& is_negative,
                                        unsigned& start_index,
                                        unsigned& end_index) {}

unsigned Locale::MatchedDecimalSymbolIndex(const String& input,
                                           unsigned& position) {}

String Locale::ConvertFromLocalizedNumber(const String& localized) {}

String Locale::StripInvalidNumberCharacters(const String& input,
                                            const String& standard_chars) {}

String Locale::LocalizedDecimalSeparator() {}

bool Locale::UsesSingleCharNumberFiltering() {}

static bool IsE(UChar ch) {}

bool Locale::IsSignPrefix(UChar ch) {}

bool Locale::HasTwoSignChars(const String& str) {}

bool Locale::HasSignNotAfterE(const String& str) {}

bool Locale::IsDigit(UChar ch) {}

// Is the character a decimal separator?
bool Locale::IsDecimalSeparator(UChar ch) {}

// Is there a decimal separator in a string?
bool Locale::HasDecimalSeparator(const String& str) {}

String Locale::FormatDateTime(const DateComponents& date,
                              FormatType format_type) {}

}  // namespace blink