| 1234567891011121314151617181920212223242526272829303132 |
- //
- // attribute_scope.hpp
- // ncurses-wrapper
- //
- // Created by Sam Jaffe on 7/23/24.
- //
- #pragma once
- #include <vector>
- #include <ncurses-wrapper/forward.h>
- namespace curses {
- class AttributeScope {
- private:
- Window *window_{nullptr};
- std::vector<NCURSES_ATTR_T> self_{};
- bool good_{true};
-
- public:
- AttributeScope() = default;
- AttributeScope(std::vector<NCURSES_ATTR_T> init, Window &window);
- AttributeScope(AttributeScope const &) = delete;
- AttributeScope(AttributeScope &&other) = default;
- AttributeScope &operator=(AttributeScope const &) = delete;
- AttributeScope &operator=(AttributeScope &&other) = default;
- ~AttributeScope();
-
- operator bool() const { return good_; }
- };
- }
|