CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
AttributedString.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
10#include "String.hpp"
11#include "Container/Map.hpp"
12
14
15namespace CeresEngine {
16
17 using CharRange = int;
18
41 private:
45
47
48 public:
50
51 public:
52 template<typename T> const T& getAttribute(const UInt32& charIdx) const;
53
54 template<typename T> void setAttribute(const CharRange& range, T&& attribute);
55 };
56
57} // namespace CeresEngine
A string that has associated attributes (such as visual style, hyperlinks, or accessibility data) for...
Definition AttributedString.hpp:40
void setAttribute(const CharRange &range, T &&attribute)
String string
The character contents of the attributed string as an String object.
Definition AttributedString.hpp:44
const T & getAttribute(const UInt32 &charIdx) const
HashMap< String, int > attributes
Definition AttributedString.hpp:46
Definition Application.hpp:19
auto range()
Returns an iterator that increases it's value from 0 to end by 1 for each step.
Definition Iterator.hpp:350
int CharRange
Definition AttributedString.hpp:17
std::unordered_map< Key, T, Hash, KeyEqual, ScopedAllocatorAdaptor< StdAllocator< Pair< const Key, T >, RawAllocator > > > HashMap
HashMap is an associative container that contains key-value pairs with unique keys.
Definition Map.hpp:33
std::uint32_t UInt32
Definition DataTypes.hpp:23
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25