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
code_complete_results.cc
compilation_database.cc
compile_command.cc
compile_commands.cc
completion_string.cc
cursor.cc
index.cc
source_location.cc
source_range.cc
token.cc
tokens.cc
translation_unit.cc
diagnostic.cc
utility.cc
code_complete_results.cpp
compilation_database.cpp
compile_command.cpp
compile_commands.cpp
completion_string.cpp
cursor.cpp
index.cpp
source_location.cpp
source_range.cpp
token.cpp
tokens.cpp
translation_unit.cpp
diagnostic.cpp
utility.cpp
)
include_directories(${LIBCLANG_INCLUDE_DIRS})
@ -22,21 +22,21 @@ target_include_directories(clangmm PUBLIC ${LIBCLANG_INCLUDE_DIRS} .)
if(${NOT_SUB_PROJECT})
install(TARGETS clangmm ARCHIVE DESTINATION lib)
install(FILES
clangmm.h
code_complete_results.h
compilation_database.h
compile_command.h
compile_commands.h
completion_string.h
cursor.h
index.h
source_location.h
source_range.h
token.h
tokens.h
translation_unit.h
diagnostic.h
utility.h
clangmm.hpp
code_complete_results.hpp
compilation_database.hpp
compile_command.hpp
compile_commands.hpp
completion_string.hpp
cursor.hpp
index.hpp
source_location.hpp
source_range.hpp
token.hpp
tokens.hpp
translation_unit.hpp
diagnostic.hpp
utility.hpp
DESTINATION include/libclangmm
)
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 "completion_string.h"
#include "utility.h"
#include "code_complete_results.hpp"
#include "completion_string.hpp"
#include "utility.hpp"
clangmm::CodeCompleteResults::CodeCompleteResults(CXTranslationUnit &cx_tu,
const std::string &buffer,

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

@ -1,6 +1,6 @@
#ifndef CODECOMPLETERESULTS_H_
#define CODECOMPLETERESULTS_H_
#include "completion_string.h"
#include "completion_string.hpp"
#include <clang-c/Index.h>
#include <map>
#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>
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_commands.h"
#include "utility.h"
#include "compile_command.hpp"
#include "compile_commands.hpp"
#include "utility.hpp"
std::vector<std::string> clangmm::CompileCommand::get_arguments() {
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) {
if(!filename.empty())

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -1,6 +1,6 @@
#ifndef DIAGNOSTIC_H_
#define DIAGNOSTIC_H_
#include "source_range.h"
#include "source_range.hpp"
#include <clang-c/Index.h>
#include <string>
#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) {
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 "utility.h"
#include "source_location.hpp"
#include "utility.hpp"
// // // // // // // //
// 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) {
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_
#define SOURCERANGE_H_
#include "source_location.h"
#include "source_location.hpp"
#include <clang-c/Index.h>
#include <string>
#include <utility>

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -1,4 +1,4 @@
#include "utility.h"
#include "utility.hpp"
#include <regex>
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_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)
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)
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)
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)
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)
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)
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)
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 <regex>
#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 <regex>
#include <string>

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

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

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

@ -1,4 +1,4 @@
#include "clangmm.h"
#include "clangmm.hpp"
#include <cassert>
#include <fstream>
#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 <memory>
#include <string>

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

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