x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
filesystem.cpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\luabind\examples\filesystem\filesystem.cpp
旋转
特效
属性
历史版本
#include
extern "C" { #include "lua.h" #include "lauxlib.h" #include "lualib.h" } #include
#include
#include
#include
#include "directory_iterator.hpp" const boost::filesystem::path& identity(const boost::filesystem::path& x) { return x; } void bind_filesystem(lua_State* L) { using namespace luabind; using namespace boost::filesystem; namespace fs = boost::filesystem; module(L, "filesystem") [ class_
("path") .def(constructor<>()) .def(constructor
()) .def("string", &fs::path::string) .def("native_file_string", &fs::path::native_file_string) .def("native_directory_string", &fs::path::native_directory_string) .def("root_path", &fs::path::root_path) .def("root_name", &fs::path::root_name) .def("root_directory", &fs::path::root_directory) .def("relative_path", &fs::path::relative_path) .def("leaf", &fs::path::leaf) .def("branch_path", &fs::path::branch_path) .def("empty", &fs::path::empty) .def("is_complete", &fs::path::is_complete) .def("is_directory", &fs::is_directory) .def("is_empty", &fs::is_empty) .def("has_root_path", &fs::path::has_root_path) .def("has_root_name", &fs::path::has_root_name) .def("has_root_directory", &fs::path::has_root_directory) .def("has_relative_path", &fs::path::has_relative_path) .def("has_leaf", &fs::path::has_leaf) .def("has_branch_path", &fs::path::has_branch_path) .def(const_self / const_self) .def(other
() / const_self) .def(const_self / other
()) // .property("contents", &identity, return_directory_iterator) , def("exists", &fs::exists), def("is_directory", &fs::is_directory), def("is_empty", &fs::is_empty), def("create_directory", &fs::create_directory), def("remove", &fs::remove), def("remove_all", &fs::remove_all), def("rename", &fs::rename), def("copy_file", &fs::copy_file), def("initial_path", &fs::initial_path), def("current_path", &fs::current_path), def("complete", &fs::complete), def("system_complete", &fs::system_complete) ]; } int main(int argc, const char* argv[]) { lua_State* L = lua_open(); luaopen_base(L); luaopen_string(L); luaopen_table(L); luaopen_math(L); luaopen_io(L); luaopen_debug(L); if (argc < 2) { std::cout << "This example will bind parts of the boost.Filesystem library\n" "and then run the given lua file.\n\n" "usage: filesystem filename [args]\n"; return 1; } using namespace luabind; open(L); bind_filesystem(L); object args = newtable(L); for (int i = 0; i < argc; ++i) { args[i + 1] = argv[i]; } args["n"] = argc; globals(L)["args"] = args; luaL_dofile(L, argv[1]); }
filesystem.cpp
网页地址
文件地址
上一页
2/5
下一页
下载
( 2 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.