/* * Copyright (C) 2015-present ScyllaDB * * Modified by ScyllaDB */ /* * SPDX-License-Identifier: (LicenseRef-ScyllaDB-Source-Available-1.0 and Apache-2.0) */ #pragma once #include #include "seastarx.hh" #include namespace cql3 { /** * Base class for the names of the keyspace elements (e.g. table, index ...) */ class keyspace_element_name { /** * The keyspace name as stored internally. */ std::optional _ks_name = std::nullopt; public: /** * Sets the keyspace. * * @param ks the keyspace name * @param keepCase true if the case must be kept, false otherwise. */ void set_keyspace(std::string_view ks, bool keep_case); /** * Checks if the keyspace is specified. * @return true if the keyspace is specified, false otherwise. */ bool has_keyspace() const; const sstring& get_keyspace() const; virtual sstring to_string() const; protected: /** * Converts the specified name into the name used internally. * * @param name the name * @param keepCase true if the case must be kept, false otherwise. * @return the name used internally. */ static sstring to_internal_name(std::string_view name, bool keep_case); }; }