]> git.ipfire.org Git - thirdparty/cups.git/blame - ppdc/ppdc-variable.cxx
License change: Apache License, Version 2.0.
[thirdparty/cups.git] / ppdc / ppdc-variable.cxx
CommitLineData
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//
e3101897 7// Licensed under Apache License v2.0. See the file "LICENSE" for more information.
ac884b6a
MS
8//
9
10//
11// Include necessary headers...
12//
13
38e73f87 14#include "ppdc-private.h"
ac884b6a
MS
15
16
17//
18// 'ppdcVariable::ppdcVariable()' - Create a variable.
19//
20
21ppdcVariable::ppdcVariable(const char *n, // I - Name of variable
22 const char *v) // I - Value of variable
94da7e34 23 : ppdcShared()
ac884b6a 24{
94da7e34
MS
25 PPDC_NEW;
26
ac884b6a
MS
27 name = new ppdcString(n);
28 value = new ppdcString(v);
29}
30
31
32//
33// 'ppdcVariable::~ppdcVariable()' - Destroy a variable.
34//
35
36ppdcVariable::~ppdcVariable()
37{
94da7e34
MS
38 PPDC_DELETE;
39
ac884b6a
MS
40 name->release();
41 value->release();
42}
43
44
45//
46// 'ppdcVariable::set_value()' - Set the value of a variable.
47//
48
49void
50ppdcVariable::set_value(const char *v)
51{
52 value->release();
53 value = new ppdcString(v);
54}