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