libroot/posix/stdio: Remove unused portions.
[haiku.git] / src / apps / icon-o-matic / import_export / Importer.cpp
blob5457822bd118b2d43a941e94800c9dcc89a6e262
1 /*
2 * Copyright 2006, Haiku. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Stephan Aßmus <superstippi@gmx.de>
7 */
9 #include "Importer.h"
11 #include "Icon.h"
12 #include "PathContainer.h"
13 #include "StyleContainer.h"
15 // constructor
16 Importer::Importer()
17 : fStyleIndexOffset(0),
18 fPathIndexOffset(0)
22 // destructor
23 Importer::~Importer()
27 // Export
28 status_t
29 Importer::Init(Icon* icon)
31 fStyleIndexOffset = 0;
32 fPathIndexOffset = 0;
34 if (!icon || icon->InitCheck() < B_OK)
35 return B_BAD_VALUE;
37 fStyleIndexOffset = icon->Styles()->CountStyles();
38 fPathIndexOffset = icon->Paths()->CountPaths();
40 return B_OK;
43 // StyleIndexFor
44 int32
45 Importer::StyleIndexFor(int32 savedIndex) const
47 return savedIndex + fStyleIndexOffset;
50 // PathIndexFor
51 int32
52 Importer::PathIndexFor(int32 savedIndex) const
54 return savedIndex + fPathIndexOffset;