C++ is a general-purpose, high-level programming language that was created as an extension of the C programming language. It was designed to provide additional features and capabilities for systems programming and other low-level applications. C++ is an object-oriented programming language, meaning that it allows developers to create and use objects that contain data and functions. […]

Grails MariaDB Dynamically Created

I have authored a c++ application that is useful in the creation of new Grails projects supporting the MariaDB relational database management system (RDBMS).  The c++ program fulfills all the perfunctory requirements to utilize MariaDB via Grails. Create the Grails Project – This is accomplished by allowing the user to select a target for the […]

Select A Directory c++

On occasion a directory needs to be selected programmatically.  The code snippet below offers sound solution. [codesyntax lang=”cpp”] std::string bcsGui::SelDir(string initDir) { string selDir; wxDirDialog dlg(NULL, “Choose input directory”, initDir, wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST); if (dlg.ShowModal() == wxID_OK) { selDir = dlg.GetPath().ToStdString(); return selDir; } dlg.Destroy(); } [/codesyntax] Include the target class into the project. [codesyntax […]

wxDialog Usage

Initialization of the process is described below. [codesyntax lang=”cpp”] void grailsGenFrame::OnmenOpt1Selected(wxCommandEvent& event) { db.listDatabases(); db.selDB(); } [/codesyntax] The definition for db is described below. [codesyntax lang=”cpp”] zDB01 db; [/codesyntax] The dialog must be initiated. [codesyntax lang=”cpp”] #ifndef ZDB01_H #define ZDB01_H #include <mysql++.h> #include <wx/arrstr.h> class zDB01 { public: zDB01(); virtual ~zDB01(); void listDatabases(); wxArrayString dbn; […]

String Array To File

The code below allows the contents of a collection of strings to be written to a text file. [codesyntax lang=”cpp”] void grailsGenFrame::saveBuild() { out.Open(“/home/archman/workspace/grails/grailsSkel/build.gradle2”); for (size_t i=0; i < str.Count(); i++) { out.AddLine(str[i]); } out.Write(); out.Close(); } [/codesyntax] Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.

File To String Array

The following code will place the contents of a text file into a string array. [codesyntax lang=”cpp”] void grailsGenFrame::OnmenOpt1Selected(wxCommandEvent& event) { wxArrayString str; str.Clear(); wxTextFile inf; wxString fbuf; inf.Open(“/home/archman/workspace/grails/grailsSkel/build.gradle”); for ( fbuf = inf.GetFirstLine(); !inf.Eof(); fbuf = inf.GetNextLine() ) { str.Add(fbuf); } } [/codesyntax]   Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored […]