Loading...
Searching...
No Matches
StringSTL.h File Reference

Overview

STL compatibility header for ultralight::String.

#include <Ultralight/StringSTL.h>

This optional header provides utility functions for converting between ultralight::String, std::string, and std::string_view. It also provides support for using ultralight::String with standard library containers and stream operators.

Precondition
This header requires C++17 or later.

Example

#include <string>
#include <iostream>
ultralight::String myStr("Hello, world!");
// Convert ultralight::String to std::string
std::string stdStr = ultralight::Convert(myStr);
// Convert std::string to ultralight::String
// Print ultralight::String to std::cout
std::cout << myStr << std::endl;
STL compatibility header for ultralight::String.
Unicode string container with conversions for UTF-8, UTF-16, and UTF-32.
Definition String.h:34
auto Convert(const From &from)
Convert between string types.
Definition StringSTL.h:99

Classes

struct  is_string_type< T >
 Trait to check if a type is a supported string-like type. More...
 
struct  is_string_type< String >
 
struct  is_string_type< std::string >
 
struct  is_string_type< std::string_view >
 
struct  is_string_type< const char * >
 
struct  hash< ultralight::String >
 Hash specialization for ultralight::String. More...
 

Functions

template<typename To = void, typename From >
auto Convert (const From &from)
 Convert between string types.
 
std::ostream & operator<< (std::ostream &os, const ultralight::String &str)
 Stream output operator for ultralight::String.
 
std::istream & operator>> (std::istream &is, ultralight::String &str)
 Stream input operator for ultralight::String.
 

Namespaces

namespace  ultralight
 
namespace  std
 

Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream & os,
const ultralight::String & str )
inline

Stream output operator for ultralight::String.

Parameters
osThe output stream.
strThe string to output.
Returns
The output stream.

◆ operator>>()

std::istream & operator>> ( std::istream & is,
ultralight::String & str )
inline

Stream input operator for ultralight::String.

Parameters
isThe input stream.
strThe string to input into.
Returns
The input stream.

Go to the source code of this file.