xref: /haiku/src/apps/icon-o-matic/document/savers/AttributeSaver.cpp (revision 8195a5a835117ab2da405e0d477153570b75d921)
1 /*
2  * Copyright 2006, Haiku. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Stephan Aßmus <superstippi@gmx.de>
7  */
8 
9 #include "AttributeSaver.h"
10 
11 #include <Node.h>
12 
13 #include "Document.h"
14 #include "FlatIconExporter.h"
15 
16 // constructor
17 AttributeSaver::AttributeSaver(const entry_ref& ref, const char* attrName)
18 	: fRef(ref),
19 	  fAttrName(attrName)
20 {
21 }
22 
23 // destructor
24 AttributeSaver::~AttributeSaver()
25 {
26 }
27 
28 // Save
29 status_t
30 AttributeSaver::Save(Document* document)
31 {
32 	BNode node(&fRef);
33 	FlatIconExporter iconExporter;
34 	return iconExporter.Export(document->Icon(), &node, fAttrName.String());
35 }
36 
37