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