]> git.ipfire.org Git - thirdparty/cups.git/blob - ppdc/ppdc-string.cxx
Remove all of the Subversion keywords from various source files.
[thirdparty/cups.git] / ppdc / ppdc-string.cxx
1 //
2 // Shared string class for the CUPS PPD Compiler.
3 //
4 // Copyright 2007-2012 by Apple Inc.
5 // Copyright 2002-2005 by Easy Software Products.
6 //
7 // These coded instructions, statements, and computer programs are the
8 // property of Apple Inc. and are protected by Federal copyright
9 // law. Distribution and use rights are outlined in the file "LICENSE.txt"
10 // which should have been included with this file. If this file is
11 // file is missing or damaged, see the license at "http://www.cups.org/".
12 //
13
14 //
15 // Include necessary headers...
16 //
17
18 #include "ppdc-private.h"
19
20
21 //
22 // 'ppdcString::ppdcString()' - Create a shared string.
23 //
24
25 ppdcString::ppdcString(const char *v) // I - String
26 : ppdcShared()
27 {
28 PPDC_NEWVAL(v);
29
30 if (v)
31 {
32 size_t vlen = strlen(v);
33
34 value = new char[vlen + 1];
35 memcpy(value, v, vlen + 1);
36 }
37 else
38 value = 0;
39 }
40
41
42 //
43 // 'ppdcString::~ppdcString()' - Destroy a shared string.
44 //
45
46 ppdcString::~ppdcString()
47 {
48 PPDC_DELETEVAL(value);
49
50 if (value)
51 delete[] value;
52 }