Inflection
Morphology Inflection
Loading...
Searching...
No Matches
SpeakableString.hpp
1/*
2 * Copyright 2017-2024 Apple Inc. All rights reserved.
3 */
4#pragma once
5
6#include <inflection/util/fwd.hpp>
7#include <inflection/dialog/fwd.hpp>
8#include <inflection/Object.hpp>
9#include <inflection/dialog/SpeakableConcept.hpp>
10#include <string>
11
15class INFLECTION_CLASS_API inflection::dialog::SpeakableString
16 : public virtual SpeakableConcept
17{
18public:
22
23private:
24 ::std::u16string print { };
25 ::std::u16string* speak { };
26
27public:
33 virtual const ::std::u16string& getPrint() const;
39 virtual const ::std::u16string& getSpeak() const;
45 virtual bool speakEqualsPrint() const;
46
50 ::std::u16string toString() const override;
56 bool operator==(const ::inflection::dialog::SpeakableString& o) const;
62 SpeakableString operator+(const ::inflection::dialog::SpeakableString& o) const;
68 SpeakableString& operator=(const ::inflection::dialog::SpeakableString& o);
74 SpeakableString& operator+=(const ::inflection::dialog::SpeakableString& o);
75
81 virtual bool isEmpty() const;
94 virtual bool contains(std::u16string_view s) const;
95
101 explicit SpeakableString(std::u16string_view print);
108 SpeakableString(std::u16string_view print, std::u16string_view speak);
117};
The base interface for all concepts that can be formatted to a SpeakableString.
Represents a string with both a spoken and written representation.
virtual const ::std::u16string & getSpeak() const
SpeakableString(std::u16string_view print, std::u16string_view speak)
virtual const ::std::u16string & getPrint() const
SpeakableString & operator+=(const ::inflection::dialog::SpeakableString &o)
SpeakableString operator+(const ::inflection::dialog::SpeakableString &o) const
bool operator==(const ::inflection::dialog::SpeakableString &o) const
SpeakableString(std::u16string_view print)
::std::u16string toString() const override
SpeakableString * toSpeakableString() const override
SpeakableString(const SpeakableString &print)
virtual bool speakEqualsPrint() const
SpeakableString & operator=(const ::inflection::dialog::SpeakableString &o)
virtual bool contains(std::u16string_view s) const
The C++ namespace for Inflection.
Definition fwd.hpp:11