1 // 2 // Constraint 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 // 'ppdcConstraint::ppdcConstraint()' - Create a constraint. 20 // 21 ppdcConstraint(const char * o1,const char * c1,const char * o2,const char * c2)22ppdcConstraint::ppdcConstraint(const char *o1, // I - First option 23 const char *c1, // I - First choice 24 const char *o2, // I - Second option 25 const char *c2) // I - Second choice 26 : ppdcShared() 27 { 28 PPDC_NEW; 29 30 option1 = new ppdcString(o1); 31 choice1 = new ppdcString(c1); 32 option2 = new ppdcString(o2); 33 choice2 = new ppdcString(c2); 34 } 35 36 37 // 38 // 'ppdcConstraint::~ppdcConstraint()' - Destroy a constraint. 39 // 40 ~ppdcConstraint()41ppdcConstraint::~ppdcConstraint() 42 { 43 PPDC_DELETE; 44 45 option1->release(); 46 choice1->release(); 47 option2->release(); 48 choice2->release(); 49 } 50