PageRenderTime 8ms CodeModel.GetById 5ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1
  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. #ifndef LL_NOTECARD_H
  27. #define LL_NOTECARD_H
  28. #include "llpointer.h"
  29. #include "llinventory.h"
  30. class LLNotecard
  31. {
  32. public:
  33. /**
  34. * @brief anonymous enumeration to set max size.
  35. */
  36. enum
  37. {
  38. MAX_SIZE = 65536
  39. };
  40. LLNotecard(S32 max_text = LLNotecard::MAX_SIZE);
  41. virtual ~LLNotecard();
  42. bool importStream(std::istream& str);
  43. bool exportStream(std::ostream& str);
  44. const std::vector<LLPointer<LLInventoryItem> >& getItems() const { return mItems; }
  45. const std::string& getText() const { return mText; }
  46. std::string& getText() { return mText; }
  47. void setItems(const std::vector<LLPointer<LLInventoryItem> >& items);
  48. void setText(const std::string& text);
  49. S32 getVersion() { return mVersion; }
  50. S32 getEmbeddedVersion() { return mEmbeddedVersion; }
  51. private:
  52. bool importEmbeddedItemsStream(std::istream& str);
  53. bool exportEmbeddedItemsStream(std::ostream& str);
  54. std::vector<LLPointer<LLInventoryItem> > mItems;
  55. std::string mText;
  56. S32 mMaxText;
  57. S32 mVersion;
  58. S32 mEmbeddedVersion;
  59. };
  60. #endif /* LL_NOTECARD_H */