mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-19 08:46:41 +01:00
Add addNewDocument method
This commit is contained in:
parent
99cd51d727
commit
382dbd5637
@ -69,6 +69,12 @@ public:
|
||||
/// Destructor
|
||||
|
||||
|
||||
Document& addNewDocument();
|
||||
/// Adds a new document for insertion. A reference to the empty document is
|
||||
/// returned. InsertRequest is the owner of the Document and will free it
|
||||
/// on destruction.
|
||||
|
||||
|
||||
Document::Vector& documents();
|
||||
/// Returns the documents to insert into the database
|
||||
|
||||
@ -87,6 +93,16 @@ private:
|
||||
};
|
||||
|
||||
|
||||
inline Document& InsertRequest::addNewDocument()
|
||||
{
|
||||
Document::Ptr doc = new Document();
|
||||
|
||||
_documents.push_back(doc);
|
||||
|
||||
return *doc;
|
||||
}
|
||||
|
||||
|
||||
inline Document::Vector& InsertRequest::documents()
|
||||
{
|
||||
return _documents;
|
||||
|
Loading…
x
Reference in New Issue
Block a user