ClangHelpers.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Copyright (C) 2013 Strahinja Val Markovic <val@markovic.io>
  2. //
  3. // This file is part of YouCompleteMe.
  4. //
  5. // YouCompleteMe is free software: you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License as published by
  7. // the Free Software Foundation, either version 3 of the License, or
  8. // (at your option) any later version.
  9. //
  10. // YouCompleteMe is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. // GNU General Public License for more details.
  14. //
  15. // You should have received a copy of the GNU General Public License
  16. // along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
  17. #ifndef CLANGHELPERS_H_T3ME71LG
  18. #define CLANGHELPERS_H_T3ME71LG
  19. #include "Diagnostic.h"
  20. #include "CompletionData.h"
  21. #include "UnsavedFile.h"
  22. #include <vector>
  23. #include <clang-c/Index.h>
  24. #include <boost/shared_ptr.hpp>
  25. #include <boost/type_traits/remove_pointer.hpp>
  26. namespace YouCompleteMe {
  27. typedef boost::shared_ptr <
  28. boost::remove_pointer< CXDiagnostic >::type > DiagnosticWrap;
  29. std::vector< CompletionData > ToCompletionDataVector(
  30. CXCodeCompleteResults *results );
  31. // NOTE: CXUnsavedFiles store pointers to data in UnsavedFiles, so UnsavedFiles
  32. // need to outlive CXUnsavedFiles!
  33. std::vector< CXUnsavedFile > ToCXUnsavedFiles(
  34. const std::vector< UnsavedFile > &unsaved_files );
  35. Diagnostic BuildDiagnostic( DiagnosticWrap diagnostic_wrap,
  36. CXTranslationUnit translation_unit );
  37. } // namespace YouCompleteMe
  38. #endif /* end of include guard: CLANGHELPERS_H_T3ME71LG */