Skip to content

Commit

Permalink
using hpp as file extension for cpp header files
Browse files Browse the repository at this point in the history
  • Loading branch information
yudonglin committed Feb 5, 2024
1 parent e62ae97 commit 0a0fdaf
Show file tree
Hide file tree
Showing 23 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion vns-cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ project(vns)
file(GLOB SOURCES "libs/*/*.h" "libs/*/*.cpp" "libs/*/*.hpp")

# Add source to this project's executable.
add_executable(vns ${SOURCES} "vns.cpp" "vns.h" "scriptProcessor.cpp" "naming.cpp" "naming.h" "content.h" "content.cpp" "contentNext.h" "contentNext.cpp" "scriptProcessor.h" "functions.h" "tests.h" "tests.cpp" "functions.cpp" "compiler.h" "compiler.cpp" "version.h" "contentManager.h" "contentManager.cpp" "decompiler.cpp" "decompiler.h")
add_executable(vns ${SOURCES} "vns.cpp" "vns.hpp" "scriptProcessor.cpp" "naming.cpp" "naming.hpp" "content.hpp" "content.cpp" "contentNext.hpp" "contentNext.cpp" "scriptProcessor.hpp" "functions.hpp" "tests.hpp" "tests.cpp" "functions.cpp" "compiler.hpp" "compiler.cpp" "version.hpp" "contentManager.hpp" "contentManager.cpp" "decompiler.cpp" "decompiler.hpp")

if (CMAKE_VERSION VERSION_GREATER 3.12)
set_property(TARGET vns PROPERTY CXX_STANDARD 20)
Expand Down
6 changes: 3 additions & 3 deletions vns-cpp/compiler.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include <ctime>
#include "version.h"
#include "compiler.h"
#include "version.hpp"
#include "compiler.hpp"
#include <fstream>
#include <iostream>
#include "scriptProcessor.h"
#include "scriptProcessor.hpp"

// get the info of compiler
std::unordered_map<std::string, int> Compiler::get_compiler_info()
Expand Down
4 changes: 2 additions & 2 deletions vns-cpp/compiler.h → vns-cpp/compiler.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef COMPILER_H
#define COMPILER_H
#ifndef COMPILER_HPP
#define COMPILER_HPP

#include <filesystem>
#include <unordered_map>
Expand Down
2 changes: 1 addition & 1 deletion vns-cpp/content.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "content.h"
#include "content.hpp"

Content::Content(const ContentDataType &data, const std::string &content_id)
{
Expand Down
6 changes: 3 additions & 3 deletions vns-cpp/content.h → vns-cpp/content.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#ifndef CONTENT_H
#define CONTENT_H
#ifndef CONTENT_HPP
#define CONTENT_HPP

#include <string>
#include <unordered_map>
#include <vector>
#include "contentNext.h"
#include "contentNext.hpp"

using ContentDataType = std::unordered_map<std::string, std::variant<std::string, std::vector<std::string>, std::unordered_map<std::string, ContentNextValueType>>>;

Expand Down
2 changes: 1 addition & 1 deletion vns-cpp/contentManager.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "contentManager.h"
#include "contentManager.hpp"

// If the pointer to the current dialog data does not exist, set_data the pointer
void ContentManager::refresh_current()
Expand Down
6 changes: 3 additions & 3 deletions vns-cpp/contentManager.h → vns-cpp/contentManager.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef CONTENT_MANAGER_H
#define CONTENT_MANAGER_H
#ifndef CONTENT_MANAGER_HPP
#define CONTENT_MANAGER_HPP

#include "content.h"
#include "content.hpp"

class ContentManager
{
Expand Down
2 changes: 1 addition & 1 deletion vns-cpp/contentNext.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "contentNext.h"
#include "contentNext.hpp"

std::unordered_map<std::string, ContentNextValueType> ContentNext::to_map() const
{
Expand Down
4 changes: 2 additions & 2 deletions vns-cpp/contentNext.h → vns-cpp/contentNext.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef CONTENT_NEXT_H
#define CONTENT_NEXT_H
#ifndef CONTENT_NEXT_HPP
#define CONTENT_NEXT_HPP

#include <string>
#include <utility>
Expand Down
4 changes: 2 additions & 2 deletions vns-cpp/decompiler.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <fstream>
#include <vector>
#include "naming.h"
#include "decompiler.h"
#include "naming.hpp"
#include "decompiler.hpp"


// If input string is nullptr, convert it to "null"
Expand Down
6 changes: 3 additions & 3 deletions vns-cpp/decompiler.h → vns-cpp/decompiler.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef DECOMPILER_H
#define DECOMPILER_H
#ifndef DECOMPILER_HPP
#define DECOMPILER_HPP

#include "contentManager.h" // Assuming you have a header file for ContentManager
#include "contentManager.hpp" // Assuming you have a header file for ContentManager

class Decompiler
{
Expand Down
2 changes: 1 addition & 1 deletion vns-cpp/functions.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "functions.h"
#include "functions.hpp"
#include <algorithm>
#include <sstream>

Expand Down
4 changes: 2 additions & 2 deletions vns-cpp/functions.h → vns-cpp/functions.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef FUNCTIONS_H
#define FUNCTIONS_H
#ifndef FUNCTIONS_HPP
#define FUNCTIONS_HPP

#include <string>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion vns-cpp/naming.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "naming.h"
#include "naming.hpp"
#include <ranges>
#include <sstream>
#include "libs/nlohmann/json.hpp"
Expand Down
4 changes: 2 additions & 2 deletions vns-cpp/naming.h → vns-cpp/naming.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef NAMING_H
#define NAMING_H
#ifndef NAMING_HPP
#define NAMING_HPP

#include <string>
#include <unordered_map>
Expand Down
6 changes: 3 additions & 3 deletions vns-cpp/scriptProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#include <cassert>
#include <stdexcept>
#include <fstream>
#include "functions.h"
#include "scriptProcessor.h"
#include "naming.h"
#include "functions.hpp"
#include "scriptProcessor.hpp"
#include "naming.hpp"

std::string ScriptProcessor::get_id() const
{
Expand Down
6 changes: 3 additions & 3 deletions vns-cpp/scriptProcessor.h → vns-cpp/scriptProcessor.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#ifndef PROCESSOR_H
#define PROCESSOR_H
#ifndef PROCESSOR_HPP
#define PROCESSOR_HPP

#include <unordered_map>
#include <unordered_set>
#include <filesystem>
#include "content.h"
#include "content.hpp"

class ScriptProcessor
{
Expand Down
10 changes: 5 additions & 5 deletions vns-cpp/tests.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include "tests.h"
#include "tests.hpp"
#include <cassert>
#include "contentNext.h"
#include "naming.h"
#include "contentNext.hpp"
#include "naming.hpp"
#include <iostream>
#include "scriptProcessor.h"
#include "compiler.h"
#include "scriptProcessor.hpp"
#include "compiler.hpp"

void TestNameWithoutTag()
{
Expand Down
4 changes: 2 additions & 2 deletions vns-cpp/tests.h → vns-cpp/tests.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef TESTS_H
#define TESTS_H
#ifndef TESTS_HPP
#define TESTS_HPP

void TestNameWithoutTag();

Expand Down
4 changes: 2 additions & 2 deletions vns-cpp/version.h → vns-cpp/version.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef VERSION_H
#define VERSION_H
#ifndef VERSION_HPP
#define VERSION_HPP

// vns main version
constexpr int VERSION = 2;
Expand Down
8 changes: 4 additions & 4 deletions vns-cpp/vns.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// vns-cpp.cpp : Defines the entry point for the application.
//

#include "vns.h"
#include "vns.hpp"
#include <unordered_map>
#include <unordered_set>
#include "tests.h"
#include "compiler.h"
#include "naming.h"
#include "tests.hpp"
#include "compiler.hpp"
#include "naming.hpp"

int main(const int argc, char **argv)
{
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions vns-python/pyvns/naming.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ from libcpp.unordered_set cimport unordered_set
cdef extern from "vns-cpp/naming.cpp":
pass

cdef extern from "vns-cpp/naming.h":
cdef extern from "vns-cpp/naming.hpp":
cdef cppclass Naming:
Naming(string)
string to_string() const
Expand All @@ -21,7 +21,7 @@ cdef extern from "vns-cpp/naming.h":
@staticmethod
string get_database_as_json()
@staticmethod
bool empty_database()
bint empty_database()
@staticmethod
void update_database(string &)

Expand Down

0 comments on commit 0a0fdaf

Please sign in to comment.