4 #include "libclang++/libclang++.hxx"
13 const size_t size = 4096;
14 cwd_ =
new char[size];
15 if (getcwd (cwd_, size) == NULL) {
17 throw std::runtime_error (
"Not enough space to store current directory name.");
33 std::vector<std::string> exclude;
36 void index (
IndexArgs & args, std::ostream & cout);
37 void update (
IndexArgs & args, std::ostream & cout);
53 void grep (
const GrepArgs & args, std::ostream & cout);
61 void complete (
CompleteArgs & args, std::ostream & cout);
65 void updateIndex_ (
IndexArgs & args, std::ostream & cout);
70 std::string directory;
71 std::vector<std::string> clArgs;
72 storage_.getCompileCommand (fileName, directory, clArgs);
76 chdir (directory.c_str());
78 auto it = tu_.find (fileName);
79 if (it == tu_.end()) {
81 return tu_.insert (std::make_pair (fileName, tu)).first->second;
90 std::map<std::string, LibClang::TranslationUnit> tu_;