コード例 #1
0
ファイル: OTPaths.cpp プロジェクト: yamamushi/opentxs
// static
bool OTPaths::AppendFile(String& out_strPath, const String& strBasePath,
                         const String& strFileName)
{
    if (!strBasePath.Exists()) {
        otErr << __FUNCTION__ << ": Null: "
              << "strBasePath"
              << " passed in!\n";
        OT_FAIL;
    }
    if (!strFileName.Exists()) {
        otErr << __FUNCTION__ << ": Null: "
              << "strFileName"
              << " passed in!\n";
        OT_FAIL;
    }

    String l_strBasePath_fix(""), l_strFileName_fix("");

    if (!FixPath(strBasePath, l_strBasePath_fix, true)) return false;
    if (!FixPath(strFileName, l_strFileName_fix, false)) return false;

    std::string l_strBasePath(l_strBasePath_fix.Get()),
        l_strFileName(l_strFileName_fix.Get());

    l_strBasePath.append(l_strFileName);

    const String l_strPath(l_strBasePath);

    out_strPath = l_strPath;
    return true;
}
コード例 #2
0
ファイル: OTPaths.cpp プロジェクト: Sollo/Open-Transactions
const bool OTPaths::AppendFile(OTString & out_strPath, const OTString & strBasePath, const OTString & strFileName)
{
	if (!strBasePath.Exists())	{ OTLog::sError("%s: Null: %s passed in!\n", __FUNCTION__, "strBasePath"); OT_ASSERT(false); }
	if (!strFileName.Exists())	{ OTLog::sError("%s: Null: %s passed in!\n", __FUNCTION__, "strFileName"); OT_ASSERT(false); }

	OTString l_strBasePath_fix(""), l_strFileName_fix("");

	if(!FixPath(strBasePath,l_strBasePath_fix,true)) return false;
	if(!FixPath(strFileName,l_strFileName_fix,false)) return false;

	std::string l_strBasePath(l_strBasePath_fix.Get()), l_strFileName(l_strFileName_fix.Get());

	l_strBasePath.append(l_strFileName);

	const OTString l_strPath(l_strBasePath);

	out_strPath = l_strPath;
	return true;
}