vfs: check userland buffers before reading them.
[haiku.git] / src / libs / print / libprint / SpoolMetaData.cpp
blob89bd9c8a3749eb0bfa151595a1c7fa89d9abdec1
1 /*
2 * SpoolMetaData.cpp
3 * Copyright 2003 Michael Pfeiffer. All Rights Reserved.
4 */
6 #include "SpoolMetaData.h"
7 #include <String.h>
9 const char *kSDDescription = "_spool/Description";
10 const char* kSDMimeType = "_spool/MimeType";
13 SpoolMetaData::SpoolMetaData(BFile* spool_file)
15 BString string;
16 time_t time;
17 if (spool_file->ReadAttrString(kSDDescription, &string) == B_OK)
18 fDescription = string.String();
20 if (spool_file->ReadAttrString(kSDMimeType, &string) == B_OK)
21 fMimeType = string.String();
23 if (spool_file->GetCreationTime(&time) == B_OK)
24 fCreationTime = ctime(&time);
28 SpoolMetaData::~SpoolMetaData()
33 const string&
34 SpoolMetaData::GetDescription() const
36 return fDescription;
40 const string&
41 SpoolMetaData::GetMimeType() const
43 return fMimeType;
47 const string&
48 SpoolMetaData::GetCreationTime() const
50 return fCreationTime;