Browse Source

Renamed C++ header and source files to use proper C++ file extensions.

master
eidheim 6 years ago
parent
commit
0e0179487b
  1. 58
      src/CMakeLists.txt
  2. 17
      src/clangmm.h
  3. 17
      src/clangmm.hpp
  4. 6
      src/code_complete_results.cpp
  5. 2
      src/code_complete_results.hpp
  6. 2
      src/compilation_database.cpp
  7. 0
      src/compilation_database.hpp
  8. 6
      src/compile_command.cpp
  9. 0
      src/compile_command.hpp
  10. 2
      src/compile_commands.cpp
  11. 4
      src/compile_commands.hpp
  12. 4
      src/completion_string.cpp
  13. 2
      src/completion_string.hpp
  14. 4
      src/cursor.cpp
  15. 4
      src/cursor.hpp
  16. 8
      src/diagnostic.cpp
  17. 2
      src/diagnostic.hpp
  18. 2
      src/index.cpp
  19. 0
      src/index.hpp
  20. 4
      src/source_location.cpp
  21. 0
      src/source_location.hpp
  22. 2
      src/source_range.cpp
  23. 2
      src/source_range.hpp
  24. 4
      src/token.cpp
  25. 6
      src/token.hpp
  26. 4
      src/tokens.cpp
  27. 4
      src/tokens.hpp
  28. 8
      src/translation_unit.cpp
  29. 10
      src/translation_unit.hpp
  30. 2
      src/utility.cpp
  31. 0
      src/utility.hpp
  32. 14
      tests/CMakeLists.txt
  33. 2
      tests/code_complete_results_test.cpp
  34. 2
      tests/completion_string_test.cpp
  35. 2
      tests/cursor_test.cpp
  36. 2
      tests/diagnostics_test.cpp
  37. 2
      tests/source_location_test.cpp
  38. 2
      tests/token_test.cpp
  39. 2
      tests/translation_unit_test.cpp

58
src/CMakeLists.txt

@ -1,18 +1,18 @@
add_library(clangmm add_library(clangmm
code_complete_results.cc code_complete_results.cpp
compilation_database.cc compilation_database.cpp
compile_command.cc compile_command.cpp
compile_commands.cc compile_commands.cpp
completion_string.cc completion_string.cpp
cursor.cc cursor.cpp
index.cc index.cpp
source_location.cc source_location.cpp
source_range.cc source_range.cpp
token.cc token.cpp
tokens.cc tokens.cpp
translation_unit.cc translation_unit.cpp
diagnostic.cc diagnostic.cpp
utility.cc utility.cpp
) )
include_directories(${LIBCLANG_INCLUDE_DIRS}) include_directories(${LIBCLANG_INCLUDE_DIRS})
@ -22,21 +22,21 @@ target_include_directories(clangmm PUBLIC ${LIBCLANG_INCLUDE_DIRS} .)
if(${NOT_SUB_PROJECT}) if(${NOT_SUB_PROJECT})
install(TARGETS clangmm ARCHIVE DESTINATION lib) install(TARGETS clangmm ARCHIVE DESTINATION lib)
install(FILES install(FILES
clangmm.h clangmm.hpp
code_complete_results.h code_complete_results.hpp
compilation_database.h compilation_database.hpp
compile_command.h compile_command.hpp
compile_commands.h compile_commands.hpp
completion_string.h completion_string.hpp
cursor.h cursor.hpp
index.h index.hpp
source_location.h source_location.hpp
source_range.h source_range.hpp
token.h token.hpp
tokens.h tokens.hpp
translation_unit.h translation_unit.hpp
diagnostic.h diagnostic.hpp
utility.h utility.hpp
DESTINATION include/libclangmm DESTINATION include/libclangmm
) )
endif() endif()

17
src/clangmm.h

@ -1,17 +0,0 @@
#ifndef CLANGMM_H_
#define CLANGMM_H_
#include "code_complete_results.h"
#include "compilation_database.h"
#include "compile_command.h"
#include "compile_commands.h"
#include "completion_string.h"
#include "cursor.h"
#include "diagnostic.h"
#include "index.h"
#include "source_location.h"
#include "source_range.h"
#include "token.h"
#include "tokens.h"
#include "translation_unit.h"
#include "utility.h"
#endif // CLANGMM_H_

17
src/clangmm.hpp

@ -0,0 +1,17 @@
#ifndef CLANGMM_H_
#define CLANGMM_H_
#include "code_complete_results.hpp"
#include "compilation_database.hpp"
#include "compile_command.hpp"
#include "compile_commands.hpp"
#include "completion_string.hpp"
#include "cursor.hpp"
#include "diagnostic.hpp"
#include "index.hpp"
#include "source_location.hpp"
#include "source_range.hpp"
#include "token.hpp"
#include "tokens.hpp"
#include "translation_unit.hpp"
#include "utility.hpp"
#endif // CLANGMM_H_

6
src/code_complete_results.cc → src/code_complete_results.cpp

@ -1,6 +1,6 @@
#include "code_complete_results.h" #include "code_complete_results.hpp"
#include "completion_string.h" #include "completion_string.hpp"
#include "utility.h" #include "utility.hpp"
clangmm::CodeCompleteResults::CodeCompleteResults(CXTranslationUnit &cx_tu, clangmm::CodeCompleteResults::CodeCompleteResults(CXTranslationUnit &cx_tu,
const std::string &buffer, const std::string &buffer,

2
src/code_complete_results.h → src/code_complete_results.hpp

@ -1,6 +1,6 @@
#ifndef CODECOMPLETERESULTS_H_ #ifndef CODECOMPLETERESULTS_H_
#define CODECOMPLETERESULTS_H_ #define CODECOMPLETERESULTS_H_
#include "completion_string.h" #include "completion_string.hpp"
#include <clang-c/Index.h> #include <clang-c/Index.h>
#include <map> #include <map>
#include <string> #include <string>

2
src/compilation_database.cc → src/compilation_database.cpp

@ -1,4 +1,4 @@
#include "compilation_database.h" #include "compilation_database.hpp"
#include <exception> #include <exception>
clangmm::CompilationDatabase::CompilationDatabase(const std::string &project_path) { clangmm::CompilationDatabase::CompilationDatabase(const std::string &project_path) {

0
src/compilation_database.h → src/compilation_database.hpp

6
src/compile_command.cc → src/compile_command.cpp

@ -1,6 +1,6 @@
#include "compile_command.h" #include "compile_command.hpp"
#include "compile_commands.h" #include "compile_commands.hpp"
#include "utility.h" #include "utility.hpp"
std::vector<std::string> clangmm::CompileCommand::get_arguments() { std::vector<std::string> clangmm::CompileCommand::get_arguments() {
unsigned size = clang_CompileCommand_getNumArgs(cx_command); unsigned size = clang_CompileCommand_getNumArgs(cx_command);

0
src/compile_command.h → src/compile_command.hpp

2
src/compile_commands.cc → src/compile_commands.cpp

@ -1,4 +1,4 @@
#include "compile_commands.h" #include "compile_commands.hpp"
clangmm::CompileCommands::CompileCommands(const std::string &filename, CompilationDatabase &db) { clangmm::CompileCommands::CompileCommands(const std::string &filename, CompilationDatabase &db) {
if(!filename.empty()) if(!filename.empty())

4
src/compile_commands.h → src/compile_commands.hpp

@ -1,7 +1,7 @@
#ifndef COMPILECOMMANDS_H_ #ifndef COMPILECOMMANDS_H_
#define COMPILECOMMANDS_H_ #define COMPILECOMMANDS_H_
#include "compilation_database.h" #include "compilation_database.hpp"
#include "compile_command.h" #include "compile_command.hpp"
#include <clang-c/CXCompilationDatabase.h> #include <clang-c/CXCompilationDatabase.h>
#include <string> #include <string>
#include <vector> #include <vector>

4
src/completion_string.cc → src/completion_string.cpp

@ -1,5 +1,5 @@
#include "completion_string.h" #include "completion_string.hpp"
#include "utility.h" #include "utility.hpp"
clangmm::CompletionChunk::CompletionChunk(std::string text, CompletionChunkKind kind) clangmm::CompletionChunk::CompletionChunk(std::string text, CompletionChunkKind kind)
: text(std::move(text)), kind(kind) {} : text(std::move(text)), kind(kind) {}

2
src/completion_string.h → src/completion_string.hpp

@ -1,6 +1,6 @@
#ifndef COMPLETIONSTRING_H_ #ifndef COMPLETIONSTRING_H_
#define COMPLETIONSTRING_H_ #define COMPLETIONSTRING_H_
#include "cursor.h" #include "cursor.hpp"
#include <clang-c/Index.h> #include <clang-c/Index.h>
#include <string> #include <string>
#include <vector> #include <vector>

4
src/cursor.cc → src/cursor.cpp

@ -1,5 +1,5 @@
#include "cursor.h" #include "cursor.hpp"
#include "utility.h" #include "utility.hpp"
std::string clangmm::Cursor::Type::get_spelling() const { std::string clangmm::Cursor::Type::get_spelling() const {
return to_string(clang_getTypeSpelling(cx_type)); return to_string(clang_getTypeSpelling(cx_type));

4
src/cursor.h → src/cursor.hpp

@ -1,7 +1,7 @@
#ifndef CURSOR_H_ #ifndef CURSOR_H_
#define CURSOR_H_ #define CURSOR_H_
#include "source_location.h" #include "source_location.hpp"
#include "source_range.h" #include "source_range.hpp"
#include <clang-c/Index.h> #include <clang-c/Index.h>
#include <string> #include <string>
#include <unordered_set> #include <unordered_set>

8
src/diagnostic.cc → src/diagnostic.cpp

@ -1,7 +1,7 @@
#include "diagnostic.h" #include "diagnostic.hpp"
#include "source_location.h" #include "source_location.hpp"
#include "tokens.h" #include "tokens.hpp"
#include "utility.h" #include "utility.hpp"
clangmm::Diagnostic::Diagnostic(CXTranslationUnit &cx_tu, CXDiagnostic &cx_diagnostic) { clangmm::Diagnostic::Diagnostic(CXTranslationUnit &cx_tu, CXDiagnostic &cx_diagnostic) {
severity = static_cast<Severity>(clang_getDiagnosticSeverity(cx_diagnostic)); severity = static_cast<Severity>(clang_getDiagnosticSeverity(cx_diagnostic));

2
src/diagnostic.h → src/diagnostic.hpp

@ -1,6 +1,6 @@
#ifndef DIAGNOSTIC_H_ #ifndef DIAGNOSTIC_H_
#define DIAGNOSTIC_H_ #define DIAGNOSTIC_H_
#include "source_range.h" #include "source_range.hpp"
#include <clang-c/Index.h> #include <clang-c/Index.h>
#include <string> #include <string>
#include <vector> #include <vector>

2
src/index.cc → src/index.cpp

@ -1,4 +1,4 @@
#include "index.h" #include "index.hpp"
clangmm::Index::Index(int excludeDeclarationsFromPCH, int displayDiagnostics) { clangmm::Index::Index(int excludeDeclarationsFromPCH, int displayDiagnostics) {
cx_index = clang_createIndex(excludeDeclarationsFromPCH, displayDiagnostics); cx_index = clang_createIndex(excludeDeclarationsFromPCH, displayDiagnostics);

0
src/index.h → src/index.hpp

4
src/source_location.cc → src/source_location.cpp

@ -1,5 +1,5 @@
#include "source_location.h" #include "source_location.hpp"
#include "utility.h" #include "utility.hpp"
// // // // // // // // // // // // // // // //
// SourceLocation // // SourceLocation //

0
src/source_location.h → src/source_location.hpp

2
src/source_range.cc → src/source_range.cpp

@ -1,4 +1,4 @@
#include "source_range.h" #include "source_range.hpp"
clangmm::SourceRange::SourceRange(const clangmm::SourceLocation &start, const clangmm::SourceLocation &end) { clangmm::SourceRange::SourceRange(const clangmm::SourceLocation &start, const clangmm::SourceLocation &end) {
cx_range = clang_getRange(start.cx_location, end.cx_location); cx_range = clang_getRange(start.cx_location, end.cx_location);

2
src/source_range.h → src/source_range.hpp

@ -1,6 +1,6 @@
#ifndef SOURCERANGE_H_ #ifndef SOURCERANGE_H_
#define SOURCERANGE_H_ #define SOURCERANGE_H_
#include "source_location.h" #include "source_location.hpp"
#include <clang-c/Index.h> #include <clang-c/Index.h>
#include <string> #include <string>
#include <utility> #include <utility>

4
src/token.cc → src/token.cpp

@ -1,5 +1,5 @@
#include "token.h" #include "token.hpp"
#include "utility.h" #include "utility.hpp"
// // // // // // // // // //
// Token // // Token //

6
src/token.h → src/token.hpp

@ -1,8 +1,8 @@
#ifndef TOKEN_H_ #ifndef TOKEN_H_
#define TOKEN_H_ #define TOKEN_H_
#include "cursor.h" #include "cursor.hpp"
#include "source_location.h" #include "source_location.hpp"
#include "source_range.h" #include "source_range.hpp"
#include <clang-c/Index.h> #include <clang-c/Index.h>
#include <string> #include <string>

4
src/tokens.cc → src/tokens.cpp

@ -1,5 +1,5 @@
#include "tokens.h" #include "tokens.hpp"
#include "utility.h" #include "utility.hpp"
#include <cstring> #include <cstring>
#include <map> #include <map>
#include <unordered_set> #include <unordered_set>

4
src/tokens.h → src/tokens.hpp

@ -1,7 +1,7 @@
#ifndef TOKENS_H_ #ifndef TOKENS_H_
#define TOKENS_H_ #define TOKENS_H_
#include "source_range.h" #include "source_range.hpp"
#include "token.h" #include "token.hpp"
#include <clang-c/Index.h> #include <clang-c/Index.h>
#include <memory> #include <memory>
#include <unordered_set> #include <unordered_set>

8
src/translation_unit.cc → src/translation_unit.cpp

@ -1,7 +1,7 @@
#include "translation_unit.h" #include "translation_unit.hpp"
#include "source_location.h" #include "source_location.hpp"
#include "tokens.h" #include "tokens.hpp"
#include "utility.h" #include "utility.hpp"
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>

10
src/translation_unit.h → src/translation_unit.hpp

@ -1,10 +1,10 @@
#ifndef TRANSLATIONUNIT_H_ #ifndef TRANSLATIONUNIT_H_
#define TRANSLATIONUNIT_H_ #define TRANSLATIONUNIT_H_
#include "code_complete_results.h" #include "code_complete_results.hpp"
#include "cursor.h" #include "cursor.hpp"
#include "diagnostic.h" #include "diagnostic.hpp"
#include "index.h" #include "index.hpp"
#include "tokens.h" #include "tokens.hpp"
#include <clang-c/Index.h> #include <clang-c/Index.h>
#include <map> #include <map>
#include <memory> #include <memory>

2
src/utility.cc → src/utility.cpp

@ -1,4 +1,4 @@
#include "utility.h" #include "utility.hpp"
#include <regex> #include <regex>
std::string clangmm::to_string(CXString cx_string) { std::string clangmm::to_string(CXString cx_string) {

0
src/utility.h → src/utility.hpp

14
tests/CMakeLists.txt

@ -1,29 +1,29 @@
add_definitions(-DLIBCLANGMM_TESTS_PATH="${CMAKE_CURRENT_SOURCE_DIR}") add_definitions(-DLIBCLANGMM_TESTS_PATH="${CMAKE_CURRENT_SOURCE_DIR}")
add_executable(code_complete_results_test code_complete_results_test.cc) add_executable(code_complete_results_test code_complete_results_test.cpp)
target_link_libraries(code_complete_results_test clangmm) target_link_libraries(code_complete_results_test clangmm)
add_test(code_complete_results_test code_complete_results_test) add_test(code_complete_results_test code_complete_results_test)
add_executable(completion_string_test completion_string_test.cc) add_executable(completion_string_test completion_string_test.cpp)
target_link_libraries(completion_string_test clangmm) target_link_libraries(completion_string_test clangmm)
add_test(completion_string_test completion_string_test) add_test(completion_string_test completion_string_test)
add_executable(cursor_test cursor_test.cc) add_executable(cursor_test cursor_test.cpp)
target_link_libraries(cursor_test clangmm) target_link_libraries(cursor_test clangmm)
add_test(cursor_test cursor_test) add_test(cursor_test cursor_test)
add_executable(diagnostics_test diagnostics_test.cc) add_executable(diagnostics_test diagnostics_test.cpp)
target_link_libraries(diagnostics_test clangmm) target_link_libraries(diagnostics_test clangmm)
add_test(diagnostics_test diagnostics_test) add_test(diagnostics_test diagnostics_test)
add_executable(source_location_test source_location_test.cc) add_executable(source_location_test source_location_test.cpp)
target_link_libraries(source_location_test clangmm) target_link_libraries(source_location_test clangmm)
add_test(source_location_test source_location_test) add_test(source_location_test source_location_test)
add_executable(token_test token_test.cc) add_executable(token_test token_test.cpp)
target_link_libraries(token_test clangmm) target_link_libraries(token_test clangmm)
add_test(token_test token_test) add_test(token_test token_test)
add_executable(translation_unit_test translation_unit_test.cc) add_executable(translation_unit_test translation_unit_test.cpp)
target_link_libraries(translation_unit_test clangmm) target_link_libraries(translation_unit_test clangmm)
add_test(translation_unit_test translation_unit_test) add_test(translation_unit_test translation_unit_test)

2
tests/code_complete_results_test.cc → tests/code_complete_results_test.cpp

@ -1,4 +1,4 @@
#include "clangmm.h" #include "clangmm.hpp"
#include <cassert> #include <cassert>
#include <regex> #include <regex>
#include <string> #include <string>

2
tests/completion_string_test.cc → tests/completion_string_test.cpp

@ -1,4 +1,4 @@
#include "clangmm.h" #include "clangmm.hpp"
#include <cassert> #include <cassert>
#include <regex> #include <regex>
#include <string> #include <string>

2
tests/cursor_test.cc → tests/cursor_test.cpp

@ -1,4 +1,4 @@
#include "clangmm.h" #include "clangmm.hpp"
#include <cassert> #include <cassert>
#include <regex> #include <regex>
#include <string> #include <string>

2
tests/diagnostics_test.cc → tests/diagnostics_test.cpp

@ -1,4 +1,4 @@
#include "clangmm.h" #include "clangmm.hpp"
#include <cassert> #include <cassert>
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>

2
tests/source_location_test.cc → tests/source_location_test.cpp

@ -1,4 +1,4 @@
#include "clangmm.h" #include "clangmm.hpp"
#include <cassert> #include <cassert>
#include <memory> #include <memory>
#include <string> #include <string>

2
tests/token_test.cc → tests/token_test.cpp

@ -1,4 +1,4 @@
#include "clangmm.h" #include "clangmm.hpp"
#include <cassert> #include <cassert>
#include <string> #include <string>

2
tests/translation_unit_test.cc → tests/translation_unit_test.cpp

@ -1,4 +1,4 @@
#include "clangmm.h" #include "clangmm.hpp"
#include <cassert> #include <cassert>
#include <map> #include <map>
#include <string> #include <string>
Loading…
Cancel
Save