/
thomas-king
/
IntegerParser
Обзор
Документация
Войти
/
thomas-king
/
IntegerParser
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
include/lib/CharacterSet.h
46 строк
768 B
AceRodstin
Add support for hexadecimal integers.
02 янв 2023, 11:42
02 янв 2023, 11:42
8f1dda5
Код
Авторство
О чём код?
// // CharacterSet.h // Libraries // // Created by Ace Rodstin on 22 Nov 2022. // #ifndef CHARACTERSET_HEADER_FILE #define CHARACTERSET_HEADER_FILE #include <set> #include <string> #include <algorithm> #include <initializer_list> #include "Range.h" using namespace std; class CharacterSet { public: using iterator = set<char>::iterator; static CharacterSet digits; static CharacterSet alphabet; static CharacterSet alpha_numeric; CharacterSet(initializer_list<Range<char>> ranges); CharacterSet(initializer_list<char> characters); void merge(const CharacterSet &other); bool contains(char character); iterator begin() const { return storage.begin(); } iterator end() const { return storage.end(); } private: set<char> storage; }; #endif