mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-12-03 12:18:11 +08:00
17c80508c0
* Drop C++14 Support * Update README.md * Remove drogon::optional in favor of std::optional * Remove drogon::filesystem in favor of std::filesystem * Remove boost::string_view and pre-c++17 hacks * Remove boost::any * Remove the string_view.h and the any.h * Remove boost lib * Update .clang-format and ci Co-authored-by: Omar Mohamed <omar@omar-laptop.lan> Co-authored-by: Ken Matsui <26405363+ken-matsui@users.noreply.github.com> Co-authored-by: An Tao <antao2002@gmail.com> Co-authored-by: albaropereyra22 <141711575+albaropereyra22@users.noreply.github.com> Co-authored-by: Yoshihiro Hokazono <47231909+hokacci@users.noreply.github.com> Co-authored-by: Omar Mohamed Khallaf <51155980+omarmohamedkh@users.noreply.github.com>
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
/**
|
|
*
|
|
* @file create_view.h
|
|
* @author An Tao
|
|
*
|
|
* Copyright 2018, An Tao. All rights reserved.
|
|
* https://github.com/an-tao/drogon
|
|
* Use of this source code is governed by a MIT license
|
|
* that can be found in the License file.
|
|
*
|
|
* Drogon
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <drogon/DrObject.h>
|
|
#include "CommandHandler.h"
|
|
using namespace drogon;
|
|
|
|
namespace drogon_ctl
|
|
{
|
|
class create_view : public DrObject<create_view>, public CommandHandler
|
|
{
|
|
public:
|
|
void handleCommand(std::vector<std::string> ¶meters) override;
|
|
|
|
std::string script() override
|
|
{
|
|
return "create view class files";
|
|
}
|
|
|
|
protected:
|
|
std::string outputPath_{"."};
|
|
std::vector<std::string> namespaces_;
|
|
bool pathToNamespaceFlag_{false};
|
|
void createViewFiles(std::vector<std::string> &cspFileNames);
|
|
int createViewFile(const std::string &script_filename);
|
|
void newViewHeaderFile(std::ofstream &file, const std::string &className);
|
|
void newViewSourceFile(std::ofstream &file,
|
|
const std::string &className,
|
|
const std::string &namespacePrefix,
|
|
std::ifstream &infile);
|
|
};
|
|
} // namespace drogon_ctl
|