Last active
April 1, 2019 16:55
-
-
Save kshaa/9fb61a297df4a3aae64a36493f5ff01e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| -- Mergefile | |
| main.cpp | |
| -- main.cpp | |
| #include <iostream> | |
| #include "lib/LinkedList/LinkedList.h" | |
| using namespace std; | |
| int main() { | |
| // Code here | |
| } | |
| -- lib/LinkedList/LinkedList.h | |
| #ifndef LIST_H | |
| #define LIST_H | |
| #include "./LinkedNode.h" | |
| template <typename ListNodeType> | |
| class LinkedList { | |
| // Class here | |
| } | |
| #endif | |
| -- lib/LinkedList/LinkedNode.h | |
| #ifndef LINKED_NODE_H | |
| #define LINKED_NODE_H | |
| template <typename LinkedNodeType> | |
| struct LinkedNode { | |
| // Struct here | |
| }; | |
| #endif | |
| -- merge.sh | |
| #!/usr/bin/env bash | |
| mergefile="Mergefile" | |
| outfile="merged_main.cpp" | |
| merge="merge.js" | |
| curl https://raw.githubusercontent.com/kshaa/single-c-file/master/single-c-file.js > $merge | |
| node $merge $mergefile $outfile | |
| rm $merge | |
| -- merged_main.cpp | |
| // Begining of include './merged_main.cpp' | |
| #include <iostream> | |
| // Begining of include './lib/LinkedList/LinkedList.h' | |
| // Begining of include './lib/LinkedList/LinkedNode.h' | |
| template <typename LinkedNodeType> | |
| struct LinkedNode { | |
| // Struct here | |
| }; | |
| // End of include './lib/LinkedList/LinkedNode.h' | |
| template <typename ListNodeType> | |
| class LinkedList { | |
| // Class here | |
| } | |
| using namespace std; | |
| // End of include './lib/LinkedList/LinkedList.h' | |
| int main() { | |
| // Code here | |
| } | |
| // End of include './merged_main.cpp' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment