xref: /haiku/src/libs/print/libprint/SpoolMetaData.cpp (revision 26db1794f9199838b3d4c8e6199f72dcf9cfec08)
1 /*
2  * SpoolMetaData.cpp
3  * Copyright 2003 Michael Pfeiffer. All Rights Reserved.
4  */
5 
6 #include "SpoolMetaData.h"
7 #include <String.h>
8 
9 const char *kSDDescription             = "_spool/Description";
10 const char* kSDMimeType                = "_spool/MimeType";
11 
12 
SpoolMetaData(BFile * spool_file)13 SpoolMetaData::SpoolMetaData(BFile* spool_file)
14 {
15 	BString string;
16 	time_t time;
17 	if (spool_file->ReadAttrString(kSDDescription, &string) == B_OK)
18 		fDescription = string.String();
19 
20 	if (spool_file->ReadAttrString(kSDMimeType, &string) == B_OK)
21 		fMimeType = string.String();
22 
23 	if (spool_file->GetCreationTime(&time) == B_OK)
24 		fCreationTime = ctime(&time);
25 }
26 
27 
~SpoolMetaData()28 SpoolMetaData::~SpoolMetaData()
29 {
30 }
31 
32 
33 const string&
GetDescription() const34 SpoolMetaData::GetDescription() const
35 {
36 	return fDescription;
37 }
38 
39 
40 const string&
GetMimeType() const41 SpoolMetaData::GetMimeType() const
42 {
43 	return fMimeType;
44 }
45 
46 
47 const string&
GetCreationTime() const48 SpoolMetaData::GetCreationTime() const
49 {
50 	return fCreationTime;
51 }
52