anton (staff) wrote:
We don't have C++ samples as we have C-style API. Some day we'll have C++ wrappers created for StarBurn SDK. Maybe. But this day will be neither tomorrow nor the day after tomorrow. You'll have to live with this
Ok, i can live with anything
But example sources are very hard to read and understand for me. Simply watch examples:
How it looks now:
Code:
//
// If it is a name collision callback
//
case CN_FILE_TREE_PROGRESS_NAME_COLLISION:
{
l__PNAME_COLLISION_INFO = ( PNAME_COLLISION_INFO )p__PVOID__CallbackSpecial1;
//
// Show common information
//
printf(
"TrackAtOnceFromTreeWithImport:Callback(): Name collision for "
);
//
// Show the name
//
if (l__PNAME_COLLISION_INFO->m__BOOLEAN__IsJolietName == FALSE)
{
printf(
"ISO9660 : <%s> -> " ,
(PCHAR)&l__PNAME_COLLISION_INFO->m__UCHAR__Name[0]
);
CorrectISO9660Name((PCHAR)&l__PNAME_COLLISION_INFO->m__UCHAR__Name[0]);
printf(
"<%s>\n" ,
(PCHAR)&l__PNAME_COLLISION_INFO->m__UCHAR__Name[0]
);
}
else
{
printf(
"Joliet : <%S> -> " ,
(USHORT *)&l__PNAME_COLLISION_INFO->m__UCHAR__Name[0]
);
CorrectJolietName((USHORT *)&l__PNAME_COLLISION_INFO->m__UCHAR__Name[0]);
printf(
"<%S>\n" ,
(USHORT *)&l__PNAME_COLLISION_INFO->m__UCHAR__Name[0]
);
}
//
// Set the our solution
//
l__PNAME_COLLISION_INFO->m__NAME_COLLISION_SOLUTION =
NAME_COLLISION_RENAME_NEW;
//NAME_COLLISION_SKIP_NEW;
//NAME_COLLISION_REPLACE_OLD;
}
break;
And how it looks when i'm starting to learn, after my small update
:
Code:
// If it is a name collision callback
case CN_FILE_TREE_PROGRESS_NAME_COLLISION:
{
pNameCollisionInfo = (PNAME_COLLISION_INFO)pCBSpecial1;
// Show common information
printf("TrackAtOnceFromTreeWithImport:Callback(): Name collision for ");
// Show the name
if (pNameCollisionInfo->bIsJolietName == FALSE)
{
printf("ISO9660 : <%s> -> ", (PCHAR)&pNameCollisionInfo->m__UCHAR__Name[0]);
CorrectISO9660Name((PCHAR)&pNameCollisionInfo->m__UCHAR__Name[0]);
printf("<%s>\n", (PCHAR)&pNameCollisionInfo->m__UCHAR__Name[0]);
} else {
printf("Joliet : <%S> -> ", (USHORT*)&pNameCollisionInfo->m__UCHAR__Name[0]);
CorrectJolietName((USHORT *)&pNameCollisionInfo->m__UCHAR__Name[0]);
printf("<%S>\n", (USHORT*)&pNameCollisionInfo->m__UCHAR__Name[0]);
}
// Set the our solution
pNameCollisionInfo->m__NAME_COLLISION_SOLUTION = NAME_COLLISION_RENAME_NEW;
}
break;
Details:
- short, clear variable names
- tabs 2 chars width
- short comments
- starting { and closing } range should be visible on monitor. Not only 22" model
Remember, we love short code - even if it only looks short
Because, short code means short work