• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Attribute class for the CUPS PPD Compiler.
3 //
4 // Copyright 2007-2009 by Apple Inc.
5 // Copyright 2002-2005 by Easy Software Products.
6 //
7 // Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
8 //
9 
10 //
11 // Include necessary headers...
12 //
13 
14 #include "ppdc-private.h"
15 
16 
17 //
18 // 'ppdcAttr::ppdcAttr()' - Create an attribute.
19 //
20 
ppdcAttr(const char * n,const char * s,const char * t,const char * v,bool loc)21 ppdcAttr::ppdcAttr(const char *n,	// I - Name
22                    const char *s,	// I - Spec string
23 		   const char *t,	// I - Human-readable text
24 		   const char *v,	// I - Value
25 		   bool       loc)	// I - Localize this attribute?
26   : ppdcShared()
27 {
28   PPDC_NEW;
29 
30   name        = new ppdcString(n);
31   selector    = new ppdcString(s);
32   text        = new ppdcString(t);
33   value       = new ppdcString(v);
34   localizable = loc;
35 }
36 
37 
38 //
39 // 'ppdcAttr::~ppdcAttr()' - Destroy an attribute.
40 //
41 
~ppdcAttr()42 ppdcAttr::~ppdcAttr()
43 {
44   PPDC_DELETE;
45 
46   name->release();
47   selector->release();
48   text->release();
49   value->release();
50 }
51