xref: /haiku/src/libs/print/libprint/SpoolMetaData.cpp (revision 13581b3d2a71545960b98fefebc5225b5bf29072)
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 
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 
28 SpoolMetaData::~SpoolMetaData()
29 {
30 }
31 
32 
33 const string&
34 SpoolMetaData::GetDescription() const
35 {
36 	return fDescription;
37 }
38 
39 
40 const string&
41 SpoolMetaData::GetMimeType() const
42 {
43 	return fMimeType;
44 }
45 
46 
47 const string&
48 SpoolMetaData::GetCreationTime() const
49 {
50 	return fCreationTime;
51 }
52