Make UEFI boot-platform build again
[haiku.git] / headers / private / shared / MessageBuilder.h
bloba5b55418fd7a27fae04ec3f62789e50e8fdde45a
1 /*
2 * Copyright 2014, Augustin Cavalier (waddlesplash)
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef MESSAGE_BUILDER_H
6 #define MESSAGE_BUILDER_H
9 #include <Message.h>
10 #include <ObjectList.h>
11 #include <String.h>
13 namespace BPrivate {
15 class BMessageBuilder {
16 public:
17 BMessageBuilder(BMessage& message);
19 status_t PushObject(const char* name);
20 status_t PushObject(uint32 name);
21 status_t PopObject();
23 uint32 What();
24 void SetWhat(uint32 what);
26 uint32 CountNames(type_code type = B_ANY_TYPE);
28 // Copied from Message.h
29 status_t AddString(const char* name, const char* string);
30 status_t AddString(const char* name,
31 const BString& string);
32 status_t AddInt8(const char* name, int8 value);
33 status_t AddUInt8(const char* name, uint8 value);
34 status_t AddInt16(const char* name, int16 value);
35 status_t AddUInt16(const char* name, uint16 value);
36 status_t AddInt32(const char* name, int32 value);
37 status_t AddUInt32(const char* name, uint32 value);
38 status_t AddInt64(const char* name, int64 value);
39 status_t AddUInt64(const char* name, uint64 value);
40 status_t AddBool(const char* name, bool value);
41 status_t AddFloat(const char* name, float value);
42 status_t AddDouble(const char* name, double value);
43 status_t AddPointer(const char* name,
44 const void* pointer);
46 private:
47 BObjectList<BMessage> fStack;
48 BObjectList<BString> fNameStack;
49 BMessage* fCurrentMessage;
52 } // namespace BPrivate
54 #endif // MESSAGE_BUILDER_H