Wt examples: wt-homepage/FileItem.h Source File

Wt examples 4.10.4

Loading...
Searching...
No Matches
FileItem.h
Go to the documentation of this file.
1// This may look like C code, but it's really -*- C++ -*-
2/*
3 * Copyright (C) 2009 Emweb bv, Herent, Belgium.
4 *
5 * See the LICENSE file for terms of use.
6 */
7
8#ifndef EXAMPLE_ITEM_H
9#define EXAMPLE_ITEM_H
10
11#include <string.h>
12
13#include "Wt/WStandardItem.h"
14#include "Wt/WStandardItemModel.h"
15#include "Wt/WString.h"
16
17#include <boost/filesystem/operations.hpp>
18#include <boost/filesystem/exception.hpp>
19
20using namespace Wt;
21
30 class FileItem : public Wt::WStandardItem
31{
32public:
33 static const Wt::ItemDataRole ContentsRole;
34 static const Wt::ItemDataRole FilePathRole;
35 static const Wt::ItemDataRole FileNameRole;
36
37 FileItem(const std::string& iconUri, const Wt::WString& text,
38 const std::string& fileName)
39 : WStandardItem(iconUri, text)
40 {
41 setData(fileName, FileNameRole);
42 setData(fileName, FilePathRole);
43 }
44};
45
46#endif // FILE_ITEM_H
FileItem
WStandardItem which stores a file.
Definition FileItem.h:31
FileItem::FileNameRole
static const Wt::ItemDataRole FileNameRole
Definition FileItem.h:35
FileItem::FilePathRole
static const Wt::ItemDataRole FilePathRole
Definition FileItem.h:34
FileItem::ContentsRole
static const Wt::ItemDataRole ContentsRole
Definition FileItem.h:33
FileItem::FileItem
FileItem(const std::string &iconUri, const Wt::WString &text, const std::string &fileName)
Definition FileItem.h:37
Wt
Definition AddresseeEdit.h:16