llvm/libc/src/__support/CPP/string.h

//===-- A simple implementation of the string class -------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_STRING_H
#define LLVM_LIBC_SRC___SUPPORT_CPP_STRING_H

#include "src/__support/CPP/string_view.h"
#include "src/__support/integer_to_string.h" // IntegerToString
#include "src/__support/macros/config.h"
#include "src/string/memory_utils/inline_memcpy.h"
#include "src/string/memory_utils/inline_memset.h"
#include "src/string/string_utils.h" // string_length

#include <stddef.h> // size_t
#include <stdlib.h> // malloc, free

namespace LIBC_NAMESPACE_DECL {
namespace cpp {

// This class mimics std::string but does not intend to be a full fledged
// implementation. Most notably it does not provide support for character traits
// nor custom allocator.
class string {};

LIBC_INLINE bool operator==(const string &lhs, const string &rhs) {}
LIBC_INLINE bool operator!=(const string &lhs, const string &rhs) {}
LIBC_INLINE bool operator<(const string &lhs, const string &rhs) {}
LIBC_INLINE bool operator<=(const string &lhs, const string &rhs) {}
LIBC_INLINE bool operator>(const string &lhs, const string &rhs) {}
LIBC_INLINE bool operator>=(const string &lhs, const string &rhs) {}

LIBC_INLINE string operator+(const string &lhs, const string &rhs) {}
LIBC_INLINE string operator+(const string &lhs, const char *rhs) {}
LIBC_INLINE string operator+(const char *lhs, const string &rhs) {}

namespace internal {
template <typename T> string to_dec_string(T value) {}
} // namespace internal

LIBC_INLINE string to_string(int value) {}
LIBC_INLINE string to_string(long value) {}
LIBC_INLINE string to_string(long long value) {}
LIBC_INLINE string to_string(unsigned value) {}
LIBC_INLINE string to_string(unsigned long value) {}
LIBC_INLINE string to_string(unsigned long long value) {}

// TODO: Support floating point
// LIBC_INLINE string to_string(float value);
// LIBC_INLINE string to_string(double value);
// LIBC_INLINE string to_string(long double value);

} // namespace cpp
} // namespace LIBC_NAMESPACE_DECL

#endif // LLVM_LIBC_SRC___SUPPORT_CPP_STRING_H