chromium/v8/src/objects/js-display-names.cc

// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_INTL_SUPPORT
#error Internationalization is expected to be enabled.
#endif  // V8_INTL_SUPPORT

#include "src/objects/js-display-names.h"

#include <memory>
#include <vector>

#include "src/execution/isolate.h"
#include "src/heap/factory.h"
#include "src/objects/intl-objects.h"
#include "src/objects/js-display-names-inl.h"
#include "src/objects/js-locale.h"
#include "src/objects/managed-inl.h"
#include "src/objects/objects-inl.h"
#include "src/objects/option-utils.h"
#include "unicode/dtfmtsym.h"
#include "unicode/dtptngen.h"
#include "unicode/localebuilder.h"
#include "unicode/locdspnm.h"
#include "unicode/measfmt.h"
#include "unicode/timezone.h"
#include "unicode/tznames.h"
#include "unicode/uloc.h"
#include "unicode/unistr.h"
#include "unicode/uscript.h"

namespace v8 {
namespace internal {

namespace {
// Type: identifying the types of the display names.
//
// ecma402/#sec-properties-of-intl-displaynames-instances
enum class Type {};

bool IsUnicodeScriptSubtag(const std::string& value) {}

bool IsUnicodeRegionSubtag(const std::string& value) {}

UDisplayContext ToUDisplayContext(JSDisplayNames::Style style) {}

}  // anonymous namespace

// Abstract class for all different types.
class DisplayNamesInternal {};

namespace {

class LocaleDisplayNamesCommon : public DisplayNamesInternal {};

class LanguageNames : public LocaleDisplayNamesCommon {};

class RegionNames : public LocaleDisplayNamesCommon {};

class ScriptNames : public LocaleDisplayNamesCommon {};

class KeyValueDisplayNames : public LocaleDisplayNamesCommon {};

class CurrencyNames : public KeyValueDisplayNames {};

class CalendarNames : public KeyValueDisplayNames {};

UDateTimePGDisplayWidth StyleToUDateTimePGDisplayWidth(
    JSDisplayNames::Style style) {}

UDateTimePatternField StringToUDateTimePatternField(const char* code) {}

class DateTimeFieldNames : public DisplayNamesInternal {};

DisplayNamesInternal* CreateInternal(const icu::Locale& locale,
                                     JSDisplayNames::Style style, Type type,
                                     bool fallback, bool dialect) {}

}  // anonymous namespace

// ecma402 #sec-Intl.DisplayNames
MaybeHandle<JSDisplayNames> JSDisplayNames::New(Isolate* isolate,
                                                DirectHandle<Map> map,
                                                Handle<Object> locales,
                                                Handle<Object> input_options) {}

// ecma402 #sec-Intl.DisplayNames.prototype.resolvedOptions
Handle<JSObject> JSDisplayNames::ResolvedOptions(
    Isolate* isolate, DirectHandle<JSDisplayNames> display_names) {}

// ecma402 #sec-Intl.DisplayNames.prototype.of
MaybeHandle<Object> JSDisplayNames::Of(
    Isolate* isolate, DirectHandle<JSDisplayNames> display_names,
    Handle<Object> code_obj) {}

namespace {

struct CheckCalendar {};

}  // namespace

const std::set<std::string>& JSDisplayNames::GetAvailableLocales() {}

Handle<String> JSDisplayNames::StyleAsString() const {}

Handle<String> JSDisplayNames::FallbackAsString() const {}

Handle<String> JSDisplayNames::LanguageDisplayAsString() const {}

}  // namespace internal
}  // namespace v8