diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2023-08-08 23:10:02 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2023-08-08 23:10:02 -0400 |
commit | f440728644ad3698ffd6af1abcfcc07aad5793c3 (patch) | |
tree | 68aff014ff17933717616f2f8d407b51611afe2b /gui/source/code.hpp |
initial commit
* combine all source files into this monorepo
* convert all third-party source packages into submodules
* small fixes due to changes in latest third-part packages
Diffstat (limited to 'gui/source/code.hpp')
-rw-r--r-- | gui/source/code.hpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/gui/source/code.hpp b/gui/source/code.hpp new file mode 100644 index 0000000..edb46e7 --- /dev/null +++ b/gui/source/code.hpp @@ -0,0 +1,39 @@ +/** + * @file code.hpp + * @brief Functionality for compiling and disassembling source code. + * + * Copyright (C) 2022 Clyne Sullivan + * + * Distributed under the GNU GPL v3 or later. You should have received a copy of + * the GNU General Public License along with this program. + * If not, see <https://www.gnu.org/licenses/>. + */ + +#ifndef STMDSPGUI_CODE_HPP +#define STMDSPGUI_CODE_HPP + +#include <fstream> +#include <istream> +#include <string> + +/** + * Attempts to open the most recently created binary file. + * @return An opened stream of the file if it exists, an empty stream otherwise. + */ +std::ifstream compileOpenBinaryFile(); + +/** + * Attempts to compile the given C++ algorithm code into a binary. + * Errors are reported to the log view. + * @param code The C++ code for the algorithm (usually from the text editor). + */ +void compileEditorCode(const std::string& code); + +/** + * Disassembles the most recently compiled binary, outputting the results to + * the log view. + */ +void disassembleCode(); + +#endif // STMDSPGUI_CODE_HPP + |