YCLIMP
Yandex Command Line Interface Music Player
Loading...
Searching...
No Matches
Utility.hpp
Go to the documentation of this file.
1
5
6#pragma once
7
8#include "Primitives.hpp"
9
10#include <string>
11#include <vector>
12
13enum class SWHolderType
14{
15 None = -1,
16 TopInfo = 0,
17 Main,
18 Additional,
19 Central
20};
21
22std::string getProjectDir();
23
37bool PrintwInLimitedX(const Vector2i& startPos, const std::string& text, int xLimit,
38 int startIndx = 0, bool truncIfNotFit = true);
39
46void printwRectangle(const Recti& rect, bool hasSelection = false, int colorPair = 1);
47
53void clearArea(const Recti& rect);
54
63void printwMsgBox(const std::string& msg, const Recti& availableSpace);
64
69void printOptionsInLine(const Vector2i& startPos, int xAvailableSpace,
70 const std::vector<std::string>& options, int selectionIndx = -1, int colorPair = 1);
71
72struct ProgressBar
73{
74 ProgressBar(char prgrsChar, int size);
75 std::string GetProgressBar(int progressPercent, int xBoundary = __INT_MAX__) const;
76
77 int size;
78 char prgrsChar;
79};
void printwMsgBox(const std::string &msg, const Recti &availableSpace)
Definition Utility.cpp:106
void printwRectangle(const Recti &rect, bool hasSelection=false, int colorPair=1)
Definition Utility.cpp:52
void printOptionsInLine(const Vector2i &startPos, int xAvailableSpace, const std::vector< std::string > &options, int selectionIndx=-1, int colorPair=1)
Definition Utility.cpp:186
void clearArea(const Recti &rect)
clearArea - clears specified rect, rect itself is not included, only area inside rectangle without bo...
Definition Utility.cpp:74
bool PrintwInLimitedX(const Vector2i &startPos, const std::string &text, int xLimit, int startIndx=0, bool truncIfNotFit=true)
Printw line in specified x boundary. if line is larger than x boundary. then truncate the line.
Definition Utility.cpp:23