I'm fairly new to c++, but I've reached a point where I want to build my own library for use in other programs. I've run into an organization issue which can be solved with namespaces and passing structs, but I'd like to organize my functions within a class. I have searched, but have not found many clear answers. I would also like to avoid having to use "friend class x" as I have written many of the functions already and plan to write more, and all the referencing could be avoided if I kept it in the same object.
class FileOps
private:
<data to be manipulated>
public:
// Target Management:
void setDir(std::string input);
void setFile(std::string target, std::string extension);
// File Management:
void listFiles(std::string manualExtension);
void setFileList();
bool fileSeek();
void deleteFile();
std::string chooseFile(std::string manualExtension);
// File Content:
void displayFileContents();
std::string randomLine();
void listManagement();
// Database Management:
void typeList();
void smartBuffer();
void dataBuffer(std::string dataType);
searchTable searchQuery;
std::string searchSimple(std::string searchType);
void searchDump();
void globalDataSearch();
void globalTermSearch();
void globalDataDump();
void dataDump(std::string dataTypeSelection);
I could easily fix this issue by turning the private data into a struct, then passing the struct through the arguments, but I'd like to create 1 object per class, then in the implimentation, reference the command something like:
Fileops x;
x.TargetManage::setDir("thisdirectory");
x.FileManage::listFiles();
... etc.
Is this possible? If so, how?