osmanip
Library with useful output stream tools like: color and style manipulators, progress bars and terminal graphics.
cursor.hpp
Go to the documentation of this file.
1 //====================================================
2 // File data
3 //====================================================
13 //====================================================
14 // Preprocessor settings
15 //====================================================
16 #pragma once
17 #ifndef OSMANIP_MANIPULATORS_CURSOR_HPP
18 #define OSMANIP_MANIPULATORS_CURSOR_HPP
19 
20 //====================================================
21 // Headers
22 //====================================================
23 
24 // My headers
26 
27 // STD headers
28 #include <cstdint>
29 #include <string>
30 #include <unordered_map>
31 #include <utility>
32 
33 namespace osm {
34 
35  //====================================================
36  // Aliases
37  //====================================================
38  using string_pair_map = std::unordered_map<std::string, std::pair<std::string, std::string>>;
39 
40  //====================================================
41  // Variables
42  //====================================================
43  extern const std::unordered_map<std::string, std::string> tcs;
44  extern const string_pair_map crs, tcsc;
45 
46  //====================================================
47  // Functions
48  //====================================================
49  extern const std::string feat(const string_pair_map &generic_map, const std::string &feat_string, int32_t feat_int);
50  extern const std::string go_to(int32_t x, int32_t y);
51 } // namespace osm
52 
53 #endif
Definition: canvas.cpp:30
std::unordered_map< std::string, std::pair< std::string, std::string > > string_pair_map
Definition: cursor.hpp:38
const std::unordered_map< std::string, std::string > tcs
It is used to store the terminal control sequences.
Definition: cursor.cpp:56
const std::string go_to(int32_t x, int32_t y)
It takes two integers as arguments which are the x and y position of the cursor in the screen and ret...
Definition: cursor.cpp:126
const string_pair_map tcsc
It is used to store the terminal control sequences for clear line / screen.
Definition: cursor.cpp:80
const string_pair_map crs
It is used to store the cursor commands.
Definition: cursor.cpp:42
const std::string & feat(const std::unordered_map< std::string, std::string > &generic_map, const std::string &feat_string)
It takes an std::map object as the first argument and an std::string object (map key) as the second a...
Definition: common.cpp:41