]> git.tdb.fi Git - builder.git/blob - source/packageref.cpp
Split class Package into SourcePackage and BinaryPackage
[builder.git] / source / packageref.cpp
1 /* $Id$
2
3 This file is part of builder
4 Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #include "builder.h"
9 #include "package.h"
10 #include "packageref.h"
11
12 using namespace std;
13
14 PackageRef::PackageRef(Builder &b, const string &n):
15         builder(b),
16         name(n),
17         package(0)
18 { }
19
20 /**
21 Tries to get the package from Builder if we don't have it already.
22
23 @return  The package pointer (0 if the package was not found)
24 */
25 Package *PackageRef::resolve()
26 {
27         if(!package)
28                 package=builder.get_package(name);
29         return package;
30 }