std::filesystemを使ってゆくぅ

filesystem
#include <iostream>
#include <filesystem>
#include <string>
#include <cassert>
 
using std::cout;
using std::cin;
using std::endl;
using std::string;
 
namespace fs = std::filesystem;
 
int main()
{
	fs::path cPath, basePath;
	cPath = fs::current_path();
	cout << cPath.string() << endl;
	basePath = cPath;
 
	string subDir("Assets");
	fs::path subPath(cPath.string() + "\\" + subDir);
	assert(fs::exists(subPath));
	//フォルダがあるときしか、ここに到達しない
	cout << subPath.string() << "は、ありま~す(晴子風)" << endl;
	fs::current_path(subPath);
	cPath = fs::current_path();
	cout << cPath.string() << endl;
 
	fs::path imageFile("Oden.jpg");
 
	if (fs::is_regular_file(imageFile))
	{
		cout << imageFile.string() << "は、ありま~す(晴子風)" << endl;
	}
 
	fs::current_path(basePath);
	cPath = fs::current_path();
	cout << cPath.string() << endl;
 
	//fs::is_regular_file()
	//初めのカレントフォルダを覚えておく->カレント表示
	//Assetsにカレントを移動->カレント表示
 
	//AssetsにOden.jpgがあるか確認->結果表示
	//カレントを元のものに戻す->カレント表示
}

Load関数に適用

FBX::Load()
//ロードしていろいろ初期化
HRESULT FBX::Load(std::string fileName) 
{
	//マネージャを生成
	FbxManager* pFbxManager = FbxManager::Create();
 
	//インポーターを生成
	FbxImporter* fbxImporter = FbxImporter::Create(pFbxManager, "imp");
	fbxImporter->Initialize(fileName.c_str(), -1, pFbxManager->GetIOSettings());
 
	//シーンオブジェクトにFBXファイルの情報を流し込む
	FbxScene* pFbxScene = FbxScene::Create(pFbxManager, "fbxscene");
	fbxImporter->Import(pFbxScene);
	fbxImporter->Destroy();
 
	//メッシュ情報を取得
	FbxNode* rootNode = pFbxScene->GetRootNode();
	FbxNode* pNode = rootNode->GetChild(0);
	FbxMesh* mesh = pNode->GetMesh();
 
	//各情報の個数を取得
	vertexCount_ = mesh->GetControlPointsCount();	//頂点の数
	polygonCount_ = mesh->GetPolygonCount();	//ポリゴンの数
	materialCount_ = pNode->GetMaterialCount();
 
	fs::path cPath, basePath;
	cPath =  fs::current_path();
	basePath = cPath;
	string subDir("Assets");
	//Assetsフォルダまでのフルパスを生成する
	fs::path subPath(cPath.string() + "\\" + subDir);
	assert(fs::exists(subPath));
	//カレントディレクトリを移動
	fs::current_path(subPath);
 
	InitVertex(mesh);
	InitIndex(mesh);
	InitConstantBuffer();
	InitMaterial(pNode);
 
	//カレントパスをもとどおりにもどす
	fs::current_path(basePath);
 
	//マネージャ解放
	pFbxManager->Destroy();
	return S_OK;
}