summaryrefslogtreecommitdiff
path: root/indra/llinventory
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@lindenlab.com>2008-06-02 21:14:31 +0000
committerBryan O'Sullivan <bos@lindenlab.com>2008-06-02 21:14:31 +0000
commit9db949eec327df4173fde3de934a87bedb0db13c (patch)
treeaeffa0f0e68b1d2ceb74d460cbbd22652c9cd159 /indra/llinventory
parent419e13d0acaabf5e1e02e9b64a07648bce822b2f (diff)
svn merge -r88066:88786 svn+ssh://svn.lindenlab.com/svn/linden/branches/cmake-9-merge
dataserver-is-deprecated for-fucks-sake-whats-with-these-commit-markers
Diffstat (limited to 'indra/llinventory')
-rw-r--r--indra/llinventory/CMakeLists.txt56
-rw-r--r--indra/llinventory/llinventory.cpp34
-rw-r--r--indra/llinventory/llinventory.h6
-rw-r--r--indra/llinventory/lltransactionflags.cpp2
4 files changed, 83 insertions, 15 deletions
diff --git a/indra/llinventory/CMakeLists.txt b/indra/llinventory/CMakeLists.txt
new file mode 100644
index 0000000000..b70548a9ba
--- /dev/null
+++ b/indra/llinventory/CMakeLists.txt
@@ -0,0 +1,56 @@
+# -*- cmake -*-
+
+project(llinventory)
+
+include(00-Common)
+include(LLCommon)
+include(LLMath)
+include(LLMessage)
+include(LLXML)
+
+include_directories(
+ ${LLCOMMON_INCLUDE_DIRS}
+ ${LLMATH_INCLUDE_DIRS}
+ ${LLMESSAGE_INCLUDE_DIRS}
+ ${LLXML_INCLUDE_DIRS}
+ )
+
+set(llinventory_SOURCE_FILES
+ llcategory.cpp
+ lleconomy.cpp
+ llinventory.cpp
+ llinventorytype.cpp
+ lllandmark.cpp
+ llnotecard.cpp
+ llparcel.cpp
+ llpermissions.cpp
+ llsaleinfo.cpp
+ lltransactionflags.cpp
+ lluserrelations.cpp
+ )
+
+set(llinventory_HEADER_FILES
+ CMakeLists.txt
+
+ llcategory.h
+ lleconomy.h
+ llinventory.h
+ llinventorytype.h
+ lllandmark.h
+ llnotecard.h
+ llparcel.h
+ llparcelflags.h
+ llpermissions.h
+ llpermissionsflags.h
+ llsaleinfo.h
+ lltransactionflags.h
+ lltransactiontypes.h
+ lluserrelations.h
+ )
+
+set_source_files_properties(${llinventory_HEADER_FILES}
+ PROPERTIES HEADER_FILE_ONLY TRUE)
+
+list(APPEND llinventory_SOURCE_FILES ${llinventory_HEADER_FILES})
+
+add_library (llinventory ${llinventory_SOURCE_FILES})
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp
index 0b28c70965..7dbc72e7a5 100644
--- a/indra/llinventory/llinventory.cpp
+++ b/indra/llinventory/llinventory.cpp
@@ -364,7 +364,7 @@ const LLString& LLInventoryItem::getDescription() const
return mDescription;
}
-S32 LLInventoryItem::getCreationDate() const
+time_t LLInventoryItem::getCreationDate() const
{
return mCreationDate;
}
@@ -422,7 +422,7 @@ void LLInventoryItem::setFlags(U32 flags)
mFlags = flags;
}
-void LLInventoryItem::setCreationDate(S32 creation_date_utc)
+void LLInventoryItem::setCreationDate(time_t creation_date_utc)
{
mCreationDate = creation_date_utc;
}
@@ -496,7 +496,9 @@ BOOL LLInventoryItem::unpackMessage(LLMessageSystem* msg, const char* block, S32
mDescription.assign(desc);
LLString::replaceNonstandardASCII(mDescription, ' ');
- msg->getS32(block, "CreationDate", mCreationDate, block_num);
+ S32 date;
+ msg->getS32(block, "CreationDate", date, block_num);
+ mCreationDate = date;
U32 local_crc = getCRC32();
U32 remote_crc = 0;
@@ -653,7 +655,9 @@ BOOL LLInventoryItem::importFile(LLFILE* fp)
}
else if(0 == strcmp("creation_date", keyword))
{
- sscanf(valuestr, "%d", &mCreationDate);
+ S32 date;
+ sscanf(valuestr, "%d", &date);
+ mCreationDate = date;
}
else
{
@@ -716,7 +720,7 @@ BOOL LLInventoryItem::exportFile(LLFILE* fp, BOOL include_asset_key) const
mSaleInfo.exportFile(fp);
fprintf(fp, "\t\tname\t%s|\n", mName.c_str());
fprintf(fp, "\t\tdesc\t%s|\n", mDescription.c_str());
- fprintf(fp, "\t\tcreation_date\t%d\n", mCreationDate);
+ fprintf(fp, "\t\tcreation_date\t%d\n", (S32) mCreationDate);
fprintf(fp,"\t}\n");
return TRUE;
}
@@ -854,7 +858,9 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream)
}
else if(0 == strcmp("creation_date", keyword))
{
- sscanf(valuestr, "%d", &mCreationDate);
+ S32 date;
+ sscanf(valuestr, "%d", &date);
+ mCreationDate = date;
}
else
{
@@ -956,7 +962,7 @@ LLSD LLInventoryItem::asLLSD() const
sd[INV_SALE_INFO_LABEL] = mSaleInfo;
sd[INV_NAME_LABEL] = mName;
sd[INV_DESC_LABEL] = mDescription;
- sd[INV_CREATION_DATE_LABEL] = mCreationDate;
+ sd[INV_CREATION_DATE_LABEL] = (S32) mCreationDate;
return sd;
}
@@ -1052,7 +1058,7 @@ bool LLInventoryItem::fromLLSD(LLSD& sd)
w = INV_CREATION_DATE_LABEL;
if (sd.has(w))
{
- mCreationDate = sd[w];
+ mCreationDate = sd[w].asInteger();
}
// Need to convert 1.0 simstate files to a useful inventory type
@@ -1116,7 +1122,8 @@ LLXMLNode *LLInventoryItem::exportFileXML(BOOL include_asset_key) const
ret->createChild("name", FALSE)->setStringValue(1, &temp);
temp.assign(mDescription);
ret->createChild("description", FALSE)->setStringValue(1, &temp);
- ret->createChild("creation_date", FALSE)->setIntValue(1, &mCreationDate);
+ S32 date = mCreationDate;
+ ret->createChild("creation_date", FALSE)->setIntValue(1, &date);
return ret;
}
@@ -1159,7 +1166,12 @@ BOOL LLInventoryItem::importXML(LLXMLNode* node)
if (node->getChild("description", sub_node))
mDescription = sub_node->getValue();
if (node->getChild("creation_date", sub_node))
- success = success && (1 == sub_node->getIntValue(1, &mCreationDate));
+ {
+ S32 date = 0;
+ success = success && (1 == sub_node->getIntValue(1, &date));
+ mCreationDate = date;
+ }
+
if (!success)
{
lldebugs << "LLInventory::importXML() failed for node named '"
@@ -1615,7 +1627,7 @@ LLSD ll_create_sd_from_inventory_item(LLPointer<LLInventoryItem> item)
rv[INV_INVENTORY_TYPE_LABEL] =
LLInventoryType::lookup(item->getInventoryType());
rv[INV_FLAGS_LABEL] = (S32)item->getFlags();
- rv[INV_CREATION_DATE_LABEL] = item->getCreationDate();
+ rv[INV_CREATION_DATE_LABEL] = (S32)item->getCreationDate();
return rv;
}
diff --git a/indra/llinventory/llinventory.h b/indra/llinventory/llinventory.h
index 6a743e2bbd..6655d6f215 100644
--- a/indra/llinventory/llinventory.h
+++ b/indra/llinventory/llinventory.h
@@ -132,7 +132,7 @@ protected:
LLSaleInfo mSaleInfo;
LLInventoryType::EType mInventoryType;
U32 mFlags;
- S32 mCreationDate; // seconds from 1/1/1970, UTC
+ time_t mCreationDate; // seconds from 1/1/1970, UTC
public:
@@ -237,7 +237,7 @@ public:
const LLSaleInfo& getSaleInfo() const;
LLInventoryType::EType getInventoryType() const;
U32 getFlags() const;
- S32 getCreationDate() const;
+ time_t getCreationDate() const;
U32 getCRC32() const; // really more of a checksum.
// mutators - will not call updateServer(), and will never fail
@@ -248,7 +248,7 @@ public:
void setPermissions(const LLPermissions& perm);
void setInventoryType(LLInventoryType::EType inv_type);
void setFlags(U32 flags);
- void setCreationDate(S32 creation_date_utc);
+ void setCreationDate(time_t creation_date_utc);
// Put this inventory item onto the current outgoing mesage. It
// assumes you have already called nextBlock().
diff --git a/indra/llinventory/lltransactionflags.cpp b/indra/llinventory/lltransactionflags.cpp
index 9b49a6b589..6b90fbdc5a 100644
--- a/indra/llinventory/lltransactionflags.cpp
+++ b/indra/llinventory/lltransactionflags.cpp
@@ -32,9 +32,9 @@
#include "linden_common.h"
+#include "lluuid.h"
#include "lltransactionflags.h"
#include "lltransactiontypes.h"
-#include "lluuid.h"
const U8 TRANSACTION_FLAGS_NONE = 0;
const U8 TRANSACTION_FLAG_SOURCE_GROUP = 1;