serialization

I'm getting a C++ compiler error with the '<<' operator. Anyone know why?

I've been working on getting this program complete where it saves multiple structs to a file, can read them back and edit them, then save them all back to a file. I've been working on the logic of this not to mention lots of help from others and a ton of googling hours... now I am getting a compile error. Any help would be very appreciat...

Compile error C++: could not deduce template argument for 'T'

I'm trying to read binary data to load structs back into memory so I can edit them and save them back to the .dat file. readVector() attempts to read the file, and return the vectors that were serialized. But i'm getting this compile error when I try and run it. What am I doing wrong with my templates? ***** EDIT ************** Code:...

Why is the size of my vector full of structs so large when I load it's serialization in from a file?

As most of you may be following my line of questions already know, i'm trying to create a program that can serialize multiple structs to a .dat file, read them back in via loading it's serialization, edit the contents, and then re-write them to the file and so on. It's a inventory program I am trying to do and I can't get it to work for ...

What am I doing wrong with my serializing a vector with structs in it to a .dat file?

If I type in Description: Apple Quantity: 10 Wholesale Cost: 30 Retail Cost: 20 Date Added: December These are the contents in my .dat file: 1Apple103020December But when I load my program, it doesn't load the struct back in correctly resulting in there being 0 items in my list. Is that what it is suppose to look like or am I do...

How to serialize big objects in .NET? (OutOfMemory Exceptions)

I'm using serialization for "save" feature in my application. But when the data is too big (15+ MB) I'm starting to get OutOfMemory exceptions. I've got so many objects and they are connected with other little objects, I think this is causing too much processing power and data held in the memory. My code is based on this, almost same: ...

Why won't my ofstream work when I put it outside my while statement?

Every time I do anything, and my while(1) gets called in my main function, my file gets cleared. It's driving me crazy. I've tried EVERYTHING. I try to put my ofstream out("data.dat"); outside the while(1) statement so it isn't called everytime but then nothing is written to the file like the ofstream isn't even working! I've tried to m...

C# deserialize unknown abstract class

I am only familiar with the basics of serialization, now I have a use for it. I have an existing reporting system with a ReportBase abstract class and multiple reports deriving from the base class. These each have different report parameters specified in the constructor and occasionally extra methods. Is it possible to serialize any of t...

Secure Serialization

I'm writing a client/server that will allow Customer Data to be shared between our head office and on-the-move sales folks within the company. The server downloads and writes the customer data in XML files but also keeps the data in memory so that it can act as a local client as it were. I'm planning to Serialize the ArrayList so that ...

WebInvoke/DataContractJsonSerializer, '1,6276' cannot be parsed as 'double'.

Hi, I am using WCF WebInvokeAttribute for declarative JSON requests (DataContractJsonSerializer), with DataContractAttribute/DataMemberAttribute based serialization. I'm using a service that supports returning JSON containing data based on different cultures. By default, this service uses en-US culture settings, which means the decimal...

Return plain objects in entity framework for serialization

I have been trying out both Linq to Sql and EF in my ASP.NET MVC application. After switching to EF I realized my XML/JSON serialization output has extra cruft. XML: <Test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; <EntityKey> <EntitySetName>Persons</EntitySetName> <...

efficient java object graph serialization

What is the best approach for serializing java object graphs? My requirements for serialization library are 1) speed of deserialization 2) size - as small as possible (smaller than in java default serialization) 3) flexibility - annotation based definitions of what has to be serialized would be nice. the underlying file format is not i...

XML serialize annotations

I have a situation where I have an xml file that I don't want to modify. The AddAnnotation function in XElement class provides an option to add memory-only data which is not serialized and not part of the XML. I want to be able to save these annotations (for example: to another xml file) and then to deserialize both the xml and the ann...

streaming XML serialization in .net

Hello, I'm trying to serialize a very large IEnumerable<MyObject> using an XmlSerializer without keeping all the objects in memory. The IEnumerable<MyObject> is actually lazy.. I'm looking for a streaming solution that will: Take an object from the IEnumerable<MyObject> Serialize it to the underlying stream using the standard seriali...

PHP object serialization and Sessions

Hi there, I have a quick question, first one too! How is it possible to serialize sub-objects to $_SESSION? Here. <?php // this is "arraytest.php" class arraytest{ private $array1 = array(); public function __construct(){ $this->array1[] = 'poodle'; } public function getarray(){ return $this->array1; ...

Can you get conditional control over serialization with DataContractSerializer?

I'm converting some of my classes to use DataContractSerialization so that I can include Linq Entities in the output. A sort of theoretical question popped into my head while I was in the process, and while I'm betting the answer is "No" I figured I'd pose the question anyway. Is there a way to conditionally serialize an object? For i...

Determining which properties to serialize in a class that's passed over a webservice

I'm using NHibernate to administer my entities, and to have lazy loading enabled I need to make my properties return an IList<>. Problem is that .NET throws an exception as it can't serialize an interface when I'm trying to pass the entity. This makes perfect sense. What I need to know is how I can control which fields to serialize, and...

What type to use to save a set of values in user control's state?

I have a base class for some kind of user controls, and in that base class and in its inherited classes I want to store some properties. I use protected override object SaveControlState() protected override void LoadControlState(object savedState) methods to save or load my custom values. Since I can work only with 1 parameter of typ...

Serialize in C++ then deserialize in C#?

Is there an easy way to serialize data in c++ (either to xml or binary), and then deserialize the data in C#? I'm working with some remote WINNT machines that won't run .Net. My server app is written entirely in C#, so I want an easy way to share simple data (key value pairs mostly, and maybe some representation of a SQL result set). I...

Synchronizing Jena OntModels with bnodes

This question relates to rcreswick's question on Serializing Jena OntModel Changes. I have Jena models on two (or more) machines that need to remain synchronized over sockets. The main issue that I need to address is that the models may contain anonymous nodes (bnodes), which can originate in any of the models. Question: Am I on the r...

WCF XML Serialization

Back in the days of 2.0 serialization I could create a serialized version of an object that would result in the following example: <transactionMessage messageDate="1/1/2001 11:00PM" messageId="abc123"> <transaction property1="Value" property2="value2" /> </transactionMessage> I would do this with the Serializable() attribute and t...