Last active
March 30, 2022 15:30
-
-
Save Sharkbyteprojects/7340bfbff7e063fd0686ebf537e92ed8 to your computer and use it in GitHub Desktop.
EXAMPLE FOR https://github.com/Sharkbyteprojects/consoleLoadingbar DESCRIBED IN USAGE SECTION OF README
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required (VERSION 3.8) | |
project ("myCool-Loadingbar-Project") | |
add_subdirectory("consoleLoadingbar") | |
add_executable (myCoolExample "exampleLoadingbar.cpp") | |
target_link_libraries(myCoolExample sharks::consoleLoadingBar) | |
add_executable (myCoolExampleWithRecalculation "exampleLoadingbar2.cpp") | |
target_link_libraries(myCoolExampleWithRecalculation sharks::consoleLoadingBar) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// <c> Sharkbyteprojects (https://github.com/Sharkbyteprojects/) | |
// THIS WORKS ON LINUX && WINDOWS | |
// INCLUDE MAIN HEADER | |
#include <consoleLoadingBar.h> | |
int main(){ | |
// Create a object of class `CloadingBarConsole` | |
CloadingBarConsole myBarClass; | |
//YELLOW SEEMS COOL: | |
myBarClass.setColorCode(colorcode::SUSPEND); | |
//MY PROGRESS IS 50% | |
myBarClass.setPercent(50); | |
//RENDER IT | |
myBarClass.render(); | |
//YOU COULD RENDER AGAIN, TO RECALCULATE THE BAR, if you didn't used stdout | |
//OTHER EXAMPLE: https://github.com/Sharkbyteprojects/consoleLoadingBar-win/blob/master/consoleLoadingBar/consoleLoadingBar.cpp (FOR NEWER VERSION, INCLUDE <consoleLoadingBar.h> instead of "../loadingBarConsole/loadingBarConsole.h") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// <c> Sharkbyteprojects (https://github.com/Sharkbyteprojects/) | |
// THIS WORKS ON LINUX && WINDOWS | |
// INCLUDE MAIN HEADER | |
#include <consoleLoadingBar.h> | |
int main(){ | |
// Create a object of class `CloadingBarConsole` | |
CloadingBarConsole myBarClass; | |
//YELLOW SEEMS COOL: | |
myBarClass.setColorCode(colorcode::SUSPEND); | |
//MY PROGRESS IS 50% | |
myBarClass.setPercent(50); | |
//RENDER IT | |
while(1) | |
myBarClass.render(); | |
//OTHER EXAMPLE: https://github.com/Sharkbyteprojects/consoleLoadingBar-win/blob/master/consoleLoadingBar/consoleLoadingBar.cpp (FOR NEWER VERSION, INCLUDE <consoleLoadingBar.h> instead of "../loadingBarConsole/loadingBarConsole.h") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment