zoukankan      html  css  js  c++  java
  • [wxWidgets]_[0基础]_[不常见但有用的类wxStandardPaths]


    场景:

    1.wxStandardPaths   用来获取各种系统路径。能够用于存放app的配置数据。比方文档文件夹,appData等。


    代码:

    #include "wx/wxprec.h"
    
    #ifndef WX_PRECOMP
        #include "wx/wx.h"
    #endif
    
    #include "wx/cmdline.h"
    #include "wx/app.h" 
    #include <assert.h>
    #include <iostream>
    #include <stdio.h>
    #include "wx/stdpaths.h"
    #include <Windows.h>
    #include <shlobj.h>
    
    using namespace std;
    
    void TestStandardPaths()
    {
    	cout << "TestStandardPaths" << endl;
    	wxStandardPaths& sp = wxStandardPaths::Get();
    	cout << "GetAppDocumentsDir (): " << sp.GetAppDocumentsDir() << endl;
    	cout << "GetDataDir (): " << sp.GetDataDir() << endl;
    	cout << "GetDocumentsDir (): " << sp.GetDocumentsDir() << endl;
    	cout << "GetExecutablePath  (): " << sp.GetExecutablePath() << endl;
    	
    	cout << "GetLocalDataDir(): " << sp.GetLocalDataDir() << endl;
    	cout << "GetPluginsDir(): " << sp.GetPluginsDir() << endl;
    	cout << "GetResourcesDir(): " << sp.GetResourcesDir() << endl;
    	cout << "GetTempDir(): " << sp.GetTempDir() << endl;
    	cout << "GetUserDataDir(): " << sp.GetUserDataDir() << endl;
    	cout << "MSWGetShellDir(): " << sp.MSWGetShellDir(CSIDL_APPDATA) << endl;
    }
    
    int main(int argc,char* argv[])
    {
    	wxInitialize();
    	wxEntryStart(argc,argv);
    	wxInitAllImageHandlers();
    
    	TestStandardPaths();
    	wxEntryCleanup();
    	wxUninitialize();
    	return 0;
    }
    
    
    
    
    

    输出:

    TestStandardPaths
    GetAppDocumentsDir (): C:UsersAdminDocuments
    GetDataDir (): E:workspace	est_project1.test_project	est_wx	est_wxCmdLineP
    arsermswDebugBin
    GetDocumentsDir (): C:UsersAdminDocuments
    GetExecutablePath  (): E:workspace	est_project1.test_project	est_wx	est_wx
    CmdLineParsermswDebugBin	est_wxCmdLineParser.exe
    GetLocalDataDir(): E:workspace	est_project1.test_project	est_wx	est_wxCmdL
    ineParsermswDebugBin
    GetPluginsDir(): E:workspace	est_project1.test_project	est_wx	est_wxCmdLin
    eParsermswDebugBin
    GetResourcesDir(): E:workspace	est_project1.test_project	est_wx	est_wxCmdL
    ineParsermswDebugBin
    GetTempDir(): C:UsersAdminAppDataLocalTemp
    GetUserDataDir(): C:UsersAdminAppDataRoaming	est_wxCmdLineParser
    MSWGetShellDir(): C:UsersAdminAppDataRoaming




  • 相关阅读:
    static,const,extern,以及全局常量
    ios开发之级联菜单(两个tableView实现)
    ios开发零散知识点总结
    ios开发static关键字的理解
    ios开发清除SDWebImage图片缓存
    python
    Scapy 伪造网络数据包
    LeetCode-73. Set Matrix Zeroes
    排序算法系列:Shell 排序算法
    Android中级第十一讲之MotionEvent的分发、拦截机制分析
  • 原文地址:https://www.cnblogs.com/blfshiye/p/5420797.html
Copyright © 2011-2022 走看看