]>
Commit | Line | Data |
---|---|---|
ac884b6a | 1 | // |
503b54c9 | 2 | // Variable class for the CUPS PPD Compiler. |
ac884b6a | 3 | // |
503b54c9 MS |
4 | // Copyright 2007-2009 by Apple Inc. |
5 | // Copyright 2002-2005 by Easy Software Products. | |
ac884b6a | 6 | // |
503b54c9 MS |
7 | // These coded instructions, statements, and computer programs are the |
8 | // property of Apple Inc. and are protected by Federal copyright | |
9 | // law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
10 | // which should have been included with this file. If this file is | |
11 | // file is missing or damaged, see the license at "http://www.cups.org/". | |
ac884b6a MS |
12 | // |
13 | ||
14 | // | |
15 | // Include necessary headers... | |
16 | // | |
17 | ||
38e73f87 | 18 | #include "ppdc-private.h" |
ac884b6a MS |
19 | |
20 | ||
21 | // | |
22 | // 'ppdcVariable::ppdcVariable()' - Create a variable. | |
23 | // | |
24 | ||
25 | ppdcVariable::ppdcVariable(const char *n, // I - Name of variable | |
26 | const char *v) // I - Value of variable | |
94da7e34 | 27 | : ppdcShared() |
ac884b6a | 28 | { |
94da7e34 MS |
29 | PPDC_NEW; |
30 | ||
ac884b6a MS |
31 | name = new ppdcString(n); |
32 | value = new ppdcString(v); | |
33 | } | |
34 | ||
35 | ||
36 | // | |
37 | // 'ppdcVariable::~ppdcVariable()' - Destroy a variable. | |
38 | // | |
39 | ||
40 | ppdcVariable::~ppdcVariable() | |
41 | { | |
94da7e34 MS |
42 | PPDC_DELETE; |
43 | ||
ac884b6a MS |
44 | name->release(); |
45 | value->release(); | |
46 | } | |
47 | ||
48 | ||
49 | // | |
50 | // 'ppdcVariable::set_value()' - Set the value of a variable. | |
51 | // | |
52 | ||
53 | void | |
54 | ppdcVariable::set_value(const char *v) | |
55 | { | |
56 | value->release(); | |
57 | value = new ppdcString(v); | |
58 | } |