John Bethencourt asked:
>I'm working on figuring out how to save a ClassAdCollection to a file. It
>seems that all the methods that do that are protected, so my code can't
>call them. How should this be done?
Your code doesn't need to call them. Instead, after you create a
ClassAdCollection, call:
virtual bool InitializeFromLog(const string &filename);
This will either create the file, or read the ClassAds from the file if it
already exists. Each time you add or modify a ClassAd, it is saved to this
file. If you frequently modify ClassAds, you may wish to call to called
TruncateLog() periodically. This will rewrite the file so it only contains
the current state of the collection instead of the sequence of changes that
were made to it.
>Also, is there any documentation available for ClassAdCollection's?
Right now, there is just the source code. Hopefully sometime soon there
will be more documentation.
-alain
|