Wt examples  4.12.2
Loading...
Searching...
No Matches
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 <Wt/cpp17/filesystem.hpp>
16
17#include "FileItem.h"
18#include "SourceView.h"
19
20using namespace Wt;
21
26{
27public:
30 ExampleSourceViewer(const std::string& deployPath,
31 const std::string& examplesRoot,
32 const std::string& examplesType);
33
34private:
37
38 std::string deployPath_;
39 std::string examplesRoot_;
40 std::string examplesType_;
41
42 std::shared_ptr<WStandardItemModel> model_;
43
45 const cpp17::filesystem::path& path);
47 const cpp17::filesystem::path& path);
49 const cpp17::filesystem::path& srcPath,
50 const std::string packageName);
51
54 void showFile();
55
56 void handlePathChange();
57
58 void setExample(const std::string& exampleDir,
59 const std::string& example);
60};
A simple widget to visualise a set of example source files.
void setExample(const std::string &exampleDir, const std::string &example)
std::shared_ptr< WStandardItemModel > model_
void cppTraverseDir(WStandardItem *parent, const cpp17::filesystem::path &path)
void showFile()
Displayed the currently selected file.
void javaTraverseDir(WStandardItem *parent, const cpp17::filesystem::path &path)
void javaTraversePackages(WStandardItem *parent, const cpp17::filesystem::path &srcPath, const std::string packageName)
View class for source code.
Definition SourceView.h:29
WWidget * parent() const