mirror of
https://github.com/fadden/ciderpress.git
synced 2025-02-20 03:29:03 +00:00
Mostly a bulk conversion of debug messages, primarily with sed: sed -e 's/\(WMSG[0-9]\)\(.*\)\(\\n"\)/LOGI\2"/' This removes the '\n' from the end of the log messages, and sets them all to "info" severity. We want to prefix each line with file/line and/or a timestamp, so it doesn't make sense to have a partial line, and there's no value in embedding the '\n' in every string.
82 lines
2.3 KiB
C++
82 lines
2.3 KiB
C++
/*
|
|
* CiderPress
|
|
* Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved.
|
|
* See the file LICENSE for distribution terms.
|
|
*/
|
|
/*
|
|
* Fill out a CTreeCtrl with the results of a tree search through a DiskFS and
|
|
* its sub-volumes.
|
|
*/
|
|
#ifndef APP_DISKFSTREE_H
|
|
#define APP_DISKFSTREE_H
|
|
|
|
#include "resource.h"
|
|
#include "../diskimg/DiskImg.h"
|
|
|
|
/*
|
|
* This class could probably be part of DiskArchive, but things are pretty
|
|
* cluttered up there already.
|
|
*/
|
|
class DiskFSTree {
|
|
public:
|
|
DiskFSTree(void) {
|
|
fIncludeSubdirs = false;
|
|
fExpandDepth = 0;
|
|
|
|
fpDiskFS = NULL;
|
|
fpTargetData = NULL;
|
|
LoadTreeImages();
|
|
}
|
|
virtual ~DiskFSTree(void) { FreeAllTargetData(); }
|
|
|
|
/*
|
|
* Create the contents of the tree control.
|
|
*/
|
|
bool BuildTree(DiskImgLib::DiskFS* pDiskFS, CTreeCtrl* pTree);
|
|
|
|
/* if set, includes folders as well as disks */
|
|
bool fIncludeSubdirs;
|
|
/* start with the tree expanded to this depth (0=none, -1=all) */
|
|
int fExpandDepth;
|
|
|
|
typedef enum {
|
|
kTargetUnknown = 0, kTargetDiskFS, kTargetSubdir
|
|
} TargetKind;
|
|
typedef struct TargetData {
|
|
TargetKind kind;
|
|
bool selectable;
|
|
DiskImgLib::DiskFS* pDiskFS;
|
|
DiskImgLib::A2File* pFile;
|
|
|
|
// easier to keep a list than to chase through the tree
|
|
struct TargetData* pNext;
|
|
} TargetData;
|
|
|
|
private:
|
|
bool AddDiskFS(CTreeCtrl* pTree, HTREEITEM root,
|
|
DiskImgLib::DiskFS* pDiskFS, int depth);
|
|
DiskImgLib::A2File* AddSubdir(CTreeCtrl* pTree, HTREEITEM parent,
|
|
DiskImgLib::DiskFS* pDiskFS, DiskImgLib::A2File* pFile,
|
|
int depth);
|
|
TargetData* AllocTargetData(void);
|
|
void FreeAllTargetData(void);
|
|
|
|
void LoadTreeImages(void) {
|
|
if (!fTreeImageList.Create(IDB_TREE_PICS, 16, 1, CLR_DEFAULT))
|
|
LOGI("GLITCH: list image create failed");
|
|
fTreeImageList.SetBkColor(::GetSysColor(COLOR_WINDOW));
|
|
}
|
|
enum { // defs for IDB_TREE_PICS
|
|
kTreeImageFolderClosed = 0,
|
|
kTreeImageFolderOpen = 1,
|
|
kTreeImageHardDriveRW = 2,
|
|
kTreeImageHardDriveRO = 3,
|
|
};
|
|
CImageList fTreeImageList;
|
|
|
|
DiskImgLib::DiskFS* fpDiskFS;
|
|
TargetData* fpTargetData;
|
|
};
|
|
|
|
#endif /*APP_DISKFSTREE_H*/
|