1*5e7646d2SAndroid Build Coastguard Worker // 2*5e7646d2SAndroid Build Coastguard Worker // Variable class for the CUPS PPD Compiler. 3*5e7646d2SAndroid Build Coastguard Worker // 4*5e7646d2SAndroid Build Coastguard Worker // Copyright 2007-2009 by Apple Inc. 5*5e7646d2SAndroid Build Coastguard Worker // Copyright 2002-2005 by Easy Software Products. 6*5e7646d2SAndroid Build Coastguard Worker // 7*5e7646d2SAndroid Build Coastguard Worker // Licensed under Apache License v2.0. See the file "LICENSE" for more information. 8*5e7646d2SAndroid Build Coastguard Worker // 9*5e7646d2SAndroid Build Coastguard Worker 10*5e7646d2SAndroid Build Coastguard Worker // 11*5e7646d2SAndroid Build Coastguard Worker // Include necessary headers... 12*5e7646d2SAndroid Build Coastguard Worker // 13*5e7646d2SAndroid Build Coastguard Worker 14*5e7646d2SAndroid Build Coastguard Worker #include "ppdc-private.h" 15*5e7646d2SAndroid Build Coastguard Worker 16*5e7646d2SAndroid Build Coastguard Worker 17*5e7646d2SAndroid Build Coastguard Worker // 18*5e7646d2SAndroid Build Coastguard Worker // 'ppdcVariable::ppdcVariable()' - Create a variable. 19*5e7646d2SAndroid Build Coastguard Worker // 20*5e7646d2SAndroid Build Coastguard Worker ppdcVariable(const char * n,const char * v)21*5e7646d2SAndroid Build Coastguard WorkerppdcVariable::ppdcVariable(const char *n, // I - Name of variable 22*5e7646d2SAndroid Build Coastguard Worker const char *v) // I - Value of variable 23*5e7646d2SAndroid Build Coastguard Worker : ppdcShared() 24*5e7646d2SAndroid Build Coastguard Worker { 25*5e7646d2SAndroid Build Coastguard Worker PPDC_NEW; 26*5e7646d2SAndroid Build Coastguard Worker 27*5e7646d2SAndroid Build Coastguard Worker name = new ppdcString(n); 28*5e7646d2SAndroid Build Coastguard Worker value = new ppdcString(v); 29*5e7646d2SAndroid Build Coastguard Worker } 30*5e7646d2SAndroid Build Coastguard Worker 31*5e7646d2SAndroid Build Coastguard Worker 32*5e7646d2SAndroid Build Coastguard Worker // 33*5e7646d2SAndroid Build Coastguard Worker // 'ppdcVariable::~ppdcVariable()' - Destroy a variable. 34*5e7646d2SAndroid Build Coastguard Worker // 35*5e7646d2SAndroid Build Coastguard Worker ~ppdcVariable()36*5e7646d2SAndroid Build Coastguard WorkerppdcVariable::~ppdcVariable() 37*5e7646d2SAndroid Build Coastguard Worker { 38*5e7646d2SAndroid Build Coastguard Worker PPDC_DELETE; 39*5e7646d2SAndroid Build Coastguard Worker 40*5e7646d2SAndroid Build Coastguard Worker name->release(); 41*5e7646d2SAndroid Build Coastguard Worker value->release(); 42*5e7646d2SAndroid Build Coastguard Worker } 43*5e7646d2SAndroid Build Coastguard Worker 44*5e7646d2SAndroid Build Coastguard Worker 45*5e7646d2SAndroid Build Coastguard Worker // 46*5e7646d2SAndroid Build Coastguard Worker // 'ppdcVariable::set_value()' - Set the value of a variable. 47*5e7646d2SAndroid Build Coastguard Worker // 48*5e7646d2SAndroid Build Coastguard Worker 49*5e7646d2SAndroid Build Coastguard Worker void set_value(const char * v)50*5e7646d2SAndroid Build Coastguard WorkerppdcVariable::set_value(const char *v) 51*5e7646d2SAndroid Build Coastguard Worker { 52*5e7646d2SAndroid Build Coastguard Worker value->release(); 53*5e7646d2SAndroid Build Coastguard Worker value = new ppdcString(v); 54*5e7646d2SAndroid Build Coastguard Worker } 55