Wt examples 4.8.2
ExampleSourceViewer.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#include <iostream>
9#include <stdlib.h>
10
11#include <Wt/WContainerWidget.h>
12#include <Wt/WTreeView.h>
13#include <Wt/WStandardItemModel.h>
14
15#include "FileItem.h"
16#include "SourceView.h"
17
18using namespace Wt;
19
23class ExampleSourceViewer: public WContainerWidget
24{
25public:
28 ExampleSourceViewer(const std::string& deployPath,
29 const std::string& examplesRoot,
30 const std::string& examplesType);
31
32private:
33 WTreeView *exampleView_;
35
36 std::string deployPath_;
37 std::string examplesRoot_;
38 std::string examplesType_;
39
40 std::shared_ptr<WStandardItemModel> model_;
41
42 void cppTraverseDir(WStandardItem* parent,
43 const boost::filesystem::path& path);
44 void javaTraverseDir(WStandardItem* parent,
45 const boost::filesystem::path& path);
46 void javaTraversePackages(WStandardItem *parent,
47 const boost::filesystem::path& srcPath,
48 const std::string packageName);
49
52 void showFile();
53
54 void handlePathChange();
55
56 void setExample(const std::string& exampleDir,
57 const std::string& example);
58};
A simple widget to visualise a set of example source files.
void cppTraverseDir(WStandardItem *parent, const boost::filesystem::path &path)
void setExample(const std::string &exampleDir, const std::string &example)
std::shared_ptr< WStandardItemModel > model_
void javaTraversePackages(WStandardItem *parent, const boost::filesystem::path &srcPath, const std::string packageName)
void showFile()
Displayed the currently selected file.
void javaTraverseDir(WStandardItem *parent, const boost::filesystem::path &path)
View class for source code.
Definition: SourceView.h:29

Generated on Sat Nov 5 2022 for the C++ Web Toolkit (Wt) by doxygen 1.9.5