Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
nzeemin committed May 10, 2024
1 parent 4297a7a commit 1210e5b
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
12 changes: 12 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,15 @@ environment:

build:
project: bkdecmd.sln

test_script:
cmd: |
cd %APPVEYOR_BUILD_FOLDER%
if %PLATFORM% == "x86" (
set RUNPATH=%CONFIGURATION%
) else (
set RUNPATH=x664\%CONFIGURATION%
)
%RUNPATH%\bkdecmd.exe i images\ANDOS330.IMG
%RUNPATH%\bkdecmd.exe l images\ANDOS330.IMG
%RUNPATH%\bkdecmd.exe lr images\ANDOS330.IMG
6 changes: 5 additions & 1 deletion BKImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ BKDirDataItem* CBKImage::FindFileRecord(std::wstring strFileName)
//}

// Спускаемся на уровень вниз, в под-директорию или в логический диск
void CBKImage::StepIntoDir(BKDirDataItem *fr)
bool CBKImage::StepIntoDir(BKDirDataItem *fr)
{
//BKDirDataItem frc;
//frc.clear();
Expand All @@ -641,6 +641,7 @@ void CBKImage::StepIntoDir(BKDirDataItem *fr)
{
//TODO: Обработка ошибки
// AfxGetMainWnd()->SendMessage(WM_SEND_ERRORNUM, WPARAM(0), static_cast<LPARAM>(m_pFloppyImage->GetErrorNumber()));
return false;
}

//// Записываем frc в стек для будущего возврата
Expand All @@ -653,6 +654,8 @@ void CBKImage::StepIntoDir(BKDirDataItem *fr)
// m_PaneInfo.nTopItem = 0;
// m_PaneInfo.nCurItem = 0;
// OutCurrFilePath();

return true;
}

// Выходим вверх из под-директории или из логического диска
Expand Down Expand Up @@ -685,6 +688,7 @@ bool CBKImage::StepUptoDir(BKDirDataItem *fr)
}
else
{
//TODO: Обработка ошибки
//AfxGetMainWnd()->SendMessage(WM_SEND_ERRORNUM, WPARAM(0), static_cast<LPARAM>(m_pFloppyImage->GetErrorNumber()));
}

Expand Down
2 changes: 1 addition & 1 deletion BKImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class CBKImage
// Печать одной строки для вывода одного элемента каталога: файла/директории
void PrintItem(BKDirDataItem& fr, const int level, std::wstring dirpath);

void StepIntoDir(BKDirDataItem* fr);
bool StepIntoDir(BKDirDataItem* fr);
bool StepUptoDir(BKDirDataItem* fr);

bool ExtractObject(BKDirDataItem* fr);
Expand Down
4 changes: 3 additions & 1 deletion BKImgFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,11 @@ std::wstring CBKImgFile::CalcImageSHA1()
? bufferSizeInBlocks
: (reminder + BLOCK_SIZE - 1) / BLOCK_SIZE;

//TODO: Показать что за ошибка
if (!ReadLBA(vec.data(), lbano, blocksToRead))
{
std::wcout << L"Проблема при чтении образа диска при подсчёте SHA1." << std::endl;
return L"";
}

hash.update(vec.data(), blocksToRead * BLOCK_SIZE);

Expand Down
18 changes: 0 additions & 18 deletions StringUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,11 @@ std::wstring strUtil::strToUpper(const std::wstring &str)

if (!str.empty())
{
#ifdef WIN32
_locale_t loc = _create_locale(LC_ALL, "Russian");
for (auto n : str)
{
res.push_back(toupper_l(n, loc));
}
_free_locale(loc);
#else
std::locale loc = std::locale("ru-ru");
for (auto n : str)
{
res.push_back(toupper(n, loc));
}
#endif
}

return res;
Expand All @@ -126,20 +117,11 @@ std::wstring strUtil::strToLower(const std::wstring &str)

if (!str.empty())
{
#ifdef WIN32
locale_t loc = _create_locale(LC_ALL, "Russian");
for (auto n : str)
{
res.push_back(tolower_l(n, loc));
}
_free_locale(loc);
#else
std::locale loc = std::locale("ru-ru");
for (auto n : str)
{
res.push_back(tolower(n, loc));
}
#endif
}

return res;
Expand Down
2 changes: 1 addition & 1 deletion imgos/BKFloppyImage_Prototype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ std::wstring CBKFloppyImage_Prototype::CalcFileSHA1(BKDirDataItem *fr)
std::vector<uint8_t> vec(EvenSizeByBlock(fr->nSize));
if (!ReadFile(fr, vec.data()))
{
//TODO: Показать ошибку
std::wcout << L"Проблема чтения файла из образа диска при подсчёте SHA1." << std::endl;
return L"";
}

Expand Down

0 comments on commit 1210e5b

Please sign in to comment.