AP_Library
AP_Library Stands for Arthur Putnam’s Library. This is my own personal library of classes I use to make new projects and speed up production time. I uploaded my source code so others could make use of some of the work I have done and to get feedback on how I can improve my methods, classes and all around programming. Thanks for all the support! -Art
AP_Console_Helper
AP_Console_Helper has functions that help display items to console. Such as centering out put on console and "text box" wrapping. For full features and details refer to the Header. void print_from_left(string print); // used to display a string from the "left" position. AP_Console_Help(); // constructor to set the default settings. string center_this_string(string center_this); // returns a string that will be centers at the "center"'s position. string center_this_string(int center_this); // returns a string that will be centers at the "center"'s position. string center_this_string(float center_this); // returns a string that will be centers at the "center"'s position. string center_this_string(double center_this); // returns a string that will be centers at the "center"'s position. string center_this_string(char center_this); // returns a string that will be centers at the "center"'s position. void println(string print); // displays "print" out to the console with a newline. (centered if "centered" is true) void println(int print); // displays "print" out to the console with a newline. (centered if "centered" is true) void println(float print); // displays "print" out to the console with a newline. (centered if "centered" is true) void println(double print);// displays "print" out to the console with a newline. (centered if "centered" is true) void println(char print); // displays "print" out to the console with a newline. (centered if "centered" is true) void print(string print); // displays "print" out to the console. (centered if "centered" is true) void print(int print); // displays "print" out to the console. (centered if "centered" is true) void print(double print); // displays "print" out to the console. (centered if "centered" is true) void print(float print); // displays "print" out to the console. (centered if "centered" is true) void print(char print); // displays "print" out to the console. (centered if "centered" is true) void from_left(string print); // displays "print" out to console after the "left" position. void from_left(int print); // displays "print" out to console after the "left" position. void from_left(double print); // displays "print" out to console after the "left" position. void from_left(float print); // displays "print" out to console after the "left" position. void from_left(char print); // displays "print" out to console after the "left" position. void box_line(); // displays a line accorrding to the box size. void box_print(string box_this); // displays "box_this" with wrapping text according to box size. void print_line(); // displays a line across the console. void print_line(int size); // displays a line a of size "size". void wait(int seconds); // pauses further excution for "seconds" seconds. void pause(); // waits for user to enter something. (entry is discarded) void toggle_centered(); // turns on or off "centered". void adjust_center(int new_center); // sets "centerd" to "new_center". void adjust_box_size(int size); // sets "box_size" to "size". void adjust_left(int from_left); // sets "left" to "from_left". Download Header for full functions and details. |
Includes: AP_Console_Helper.h, AP_Console_Helper.cpp and the AP-License Agreement. |
AP_String_Helper
This class has functions used to manipulate and manage strings. The documentation describes how each method can be used. Some of the commonly used methods are find, from_to, remove, to_upper, to_lower. and replace.
string from_to(string a_string, int place); // returns a string form the beginning of "a_string" up to "place".
string from_to(string a_string, char stop); // returns a string from the beginning of "a_string" up to "stop". string from_to(string a_string, int start, int stop); string to_upper(string a_string); // makes all lower case characters into upper case. string to_lower(string a_string); // makes all upper case characters into lower case. bool find(string a_string, string match); // returns true if a instance of "match" is found in a_string. int find_next(string match, int at, string a_string);// returns the next occurrence of "match" starting from "at" in the string "a_string". int occurrences(string a_string, string match); // returns the number of Occurrences of "match" in "a_string". string remove(string a_string, string removed); // removes any instance of "removed" from the string a_string. string remove_numbers(string a_string); // removes any instance of numbers from the string a_string. string replace_with(string remove, string replace, string a_string); //replaces "remove" out of the string and replaces it with "replace" in the string "a_string" string to_string(int number);// converts to a string equivalent string to_string(float number);// converts to a string equivalent string to_string(double number);// converts to a string equivalent string to_string(char character);// converts to a string equivalent Download Header for full functions and details. |
Includes: AP_String_Helper.h, AP_String_Helper.ccp and the AP-License Agreement. |
AP_File_Handler
This class can be used to do file i/o. Read and Write files with ease. string read_next_line(); // returns the next line as a string (referrs to place for location) string read_previous_line(); // returns the previous line string read_line_at(int return_place); // returns the line located at "return_place" void refresh_file(); // resets the boolean read to false. Next read line will refresh the vector. void set_file_name(string name); // sets the file name and sets the boolean "read" to false. int return_size();// returns the amount of lines in the file. void write_add_line(string line); // adds a line to the vector. void write_remove_last(); // removes last line from vector. void write_remove_line(string line); // removes the first line that matches "line". void write_remove_line(int place); // removes the line at position "place". void write_to_File(); // writes the strings from the vector "file_contents" to file. (each string is a seperate line). Download Header for full functions and details. |
|