summaryrefslogtreecommitdiff
path: root/indra/llinventory/llnotecard.h
blob: 04fe666562375887d7d0711ec10daf0d148aeff1 (plain)
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
/** 
 * @file llnotecard.h
 * @brief LLNotecard class declaration
 *
 * Copyright (c) 2006-$CurrentYear$, Linden Research, Inc.
 * $License$
 */

#ifndef LL_NOTECARD_H
#define LL_NOTECARD_H

#include "llmemory.h"
#include "llinventory.h"

class LLNotecard
{
public:
	/**
	 * @brief anonymous enumeration to set max size.
	 */
	enum
	{
		MAX_SIZE = 65536
	};
	
	LLNotecard(S32 max_text = LLNotecard::MAX_SIZE);
	virtual ~LLNotecard();

	bool importStream(std::istream& str);
	bool exportStream(std::ostream& str);

	const std::vector<LLPointer<LLInventoryItem> >& getItems() const;
	LLString& getText();

	void setItems(const std::vector<LLPointer<LLInventoryItem> >& items);
	void setText(const LLString& text);
	S32 getVersion() { return mVersion; }
	S32 getEmbeddedVersion() { return mEmbeddedVersion; }
	
private:
	bool importEmbeddedItemsStream(std::istream& str);
	bool exportEmbeddedItemsStream(std::ostream& str);
	std::vector<LLPointer<LLInventoryItem> > mItems;
	LLString mText;
	S32 mMaxText;
	S32 mVersion;
	S32 mEmbeddedVersion;
};

#endif /* LL_NOTECARD_H */