PageRenderTime 24ms CodeModel.GetById 16ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llinventory/llnotecard.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 69 lines | 32 code | 9 blank | 28 comment | 0 complexity | 594e51b7bc640b2f514034858cc4d19b MD5 | raw file
 1/** 
 2 * @file llnotecard.h
 3 * @brief LLNotecard class declaration
 4 *
 5 * $LicenseInfo:firstyear=2006&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#ifndef LL_NOTECARD_H
28#define LL_NOTECARD_H
29
30#include "llpointer.h"
31#include "llinventory.h"
32
33class LLNotecard
34{
35public:
36	/**
37	 * @brief anonymous enumeration to set max size.
38	 */
39	enum
40	{
41		MAX_SIZE = 65536
42	};
43	
44	LLNotecard(S32 max_text = LLNotecard::MAX_SIZE);
45	virtual ~LLNotecard();
46
47	bool importStream(std::istream& str);
48	bool exportStream(std::ostream& str);
49
50	const std::vector<LLPointer<LLInventoryItem> >& getItems() const { return mItems; }
51	const std::string& getText() const { return mText; }
52	std::string& getText() { return mText; }
53
54	void setItems(const std::vector<LLPointer<LLInventoryItem> >& items);
55	void setText(const std::string& text);
56	S32 getVersion() { return mVersion; }
57	S32 getEmbeddedVersion() { return mEmbeddedVersion; }
58	
59private:
60	bool importEmbeddedItemsStream(std::istream& str);
61	bool exportEmbeddedItemsStream(std::ostream& str);
62	std::vector<LLPointer<LLInventoryItem> > mItems;
63	std::string mText;
64	S32 mMaxText;
65	S32 mVersion;
66	S32 mEmbeddedVersion;
67};
68
69#endif /* LL_NOTECARD_H */