forked from Andersbakken/rtags
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIndexMessage.h
63 lines (53 loc) · 2.28 KB
/
IndexMessage.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* This file is part of RTags (http://rtags.net).
RTags is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
RTags is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RTags. If not, see <http://www.gnu.org/licenses/>. */
#ifndef IndexMessage_h
#define IndexMessage_h
#include "rct/Flags.h"
#include "rct/List.h"
#include "rct/String.h"
#include "RTagsMessage.h"
class IndexMessage : public RTagsMessage
{
public:
enum { MessageId = CompileId };
IndexMessage();
const Path &projectRoot() const { return mProjectRoot; }
void setProjectRoot(const Path &projectRoot) { mProjectRoot = projectRoot; }
const Path &workingDirectory() const { return mWorkingDirectory; }
void setWorkingDirectory(Path &&wd) { mWorkingDirectory = std::move(wd); }
void setEnvironment(const List<String> &environment) { mEnvironment = environment; }
const List<String> &environment() const { return mEnvironment; }
List<String> &&takeEnvironment() { return std::move(mEnvironment); }
Path compileCommands() const { return mCompileCommands; }
void setCompileCommands(Path &&path) { mCompileCommands = std::move(path); }
const String &arguments() const { return mArgs; }
String &&takeArguments() { return std::move(mArgs); }
void setArguments(String &&args) { mArgs = std::move(args); }
enum Flag {
None = 0x0,
GuessFlags = 0x1
};
Flags<Flag> flags() const { return mFlags; }
void setFlags(Flags<Flag> f) { mFlags = f; }
void setFlag(Flag flag, bool on = true) { mFlags.set(flag, on); }
virtual void encode(Serializer &serializer) const override;
virtual void decode(Deserializer &deserializer) override;
private:
Path mWorkingDirectory;
String mArgs;
List<String> mEnvironment;
Path mProjectRoot;
Path mCompileCommands;
Flags<Flag> mFlags;
};
RCT_FLAGS(IndexMessage::Flag);
#endif