Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 57 lines (46 sloc) 1.561 kB
efd7b1d @mhroth Add support for comments (i.e. "#X text" objects).
authored
1 /*
f85da5f @mhroth Fix bug in MessageText in which wrong pointer to comment was being st…
authored
2 * Copyright 2010,2011 Reality Jockey, Ltd.
efd7b1d @mhroth Add support for comments (i.e. "#X text" objects).
authored
3 * info@rjdj.me
4 * http://rjdj.me/
5 *
6 * This file is part of ZenGarden.
7 *
8 * ZenGarden is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * ZenGarden is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with ZenGarden. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23 #ifndef _MESSAGE_TEXT_H_
24 #define _MESSAGE_TEXT_H_
25
26 #include "MessageObject.h"
27
28 /** The object representing a comment. */
29 class MessageText : public MessageObject {
30
31 public:
7329847 @mhroth Add static factory method to all objects in order to create an object…
authored
32 static MessageObject *newObject(PdMessage *initMessage, PdGraph *graph);
33 MessageText(PdMessage *initMessage, PdGraph *graph);
efd7b1d @mhroth Add support for comments (i.e. "#X text" objects).
authored
34 ~MessageText();
35
3f6a39c @Kyew Rewrote header functions as inline, add toString to all objects
Kyew authored
36 static const char *getObjectLabel();
37 std::string toString();
efd7b1d @mhroth Add support for comments (i.e. "#X text" objects).
authored
38
eed621f @mhroth Move BufferPool to PdContext. When computing process order, make it g…
authored
39 const char *getComment() { return comment; }
efd7b1d @mhroth Add support for comments (i.e. "#X text" objects).
authored
40
41 private:
42 char *comment;
43 };
44
3f6a39c @Kyew Rewrote header functions as inline, add toString to all objects
Kyew authored
45 inline const char *MessageText::getObjectLabel() {
46 return "text";
47 }
48
49 inline std::string MessageText::toString() {
50 return std::string(MessageText::getObjectLabel())
51 + " '"
52 + comment
53 + "'";
54 }
55
efd7b1d @mhroth Add support for comments (i.e. "#X text" objects).
authored
56 #endif // _MESSAGE_TEXT_H_
Something went wrong with that request. Please try again.