I've been stalled for a couple of days trying to figure out how to do the initialization(INI file) stuff, basically on how to do the user defined functionality, and create a flexible system to allow changes etc, and capture them for save/reload.
I think I've figured out how I want to do it, which is using the public domain pugxml header, so that everything is stored in XML in the config file, and then presumably is easily displayable and configurable in the application.
Configuration can be such a pain sometimes, especially when you need complex structures to be represented in your INI file. In the past I have done this be embedding PERL in the application and using perl scripts to generate the init information, using functions, regex, function call by name, etc., but embedding PERL uses up memory (about a MB per instance plus code/library overhead), and I'm trying to keep the memory footprint (outside of copy bufffers, DLL's, etc.) down to something reasonable.
So the pugxml stuff looks pretty good as it is a single header XML parser.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've been stalled for a couple of days trying to figure out how to do the initialization(INI file) stuff, basically on how to do the user defined functionality, and create a flexible system to allow changes etc, and capture them for save/reload.
I think I've figured out how I want to do it, which is using the public domain pugxml header, so that everything is stored in XML in the config file, and then presumably is easily displayable and configurable in the application.
Configuration can be such a pain sometimes, especially when you need complex structures to be represented in your INI file. In the past I have done this be embedding PERL in the application and using perl scripts to generate the init information, using functions, regex, function call by name, etc., but embedding PERL uses up memory (about a MB per instance plus code/library overhead), and I'm trying to keep the memory footprint (outside of copy bufffers, DLL's, etc.) down to something reasonable.
So the pugxml stuff looks pretty good as it is a single header XML parser.
So Here is what I've gotten so far for the XML Config file:
<Config>
<General>
<MaximizeOnStart>0</MaximizeOnStart>
<SplashScreen>0</SplashScreen>
</General>
<Vars>
<Destinations>
<Name>_defaultdests_</Name>
<Value>y:\burn,y:\burn\divx,c:\convertavi</Value>
</Destinations>
</Vars>
<Tasks>
<Task number="0">
<Name>UserDefinedBase</Name>
</Task>
<Task number="1">
<Name>Repair</Name>
<Extensions>par2, par</Extensions
<MenuText>Repair</MenuText>
<MenuShow>true</MenuShow>
<DeleteSources>true</DeleteSources>
<CommandLine>par2.exe r %1</CommandLine>
<Display>
Put any ListView Display info here
</Display>
</Task>
<Task number="2">
<Name>Extract</Name>
<Extensions>rar, 001, zip, ace</Extensions
<MenuText>Extract to</MenuText>
<MenuShow>true</MenuShow>
<DeleteSources>true</DeleteSources>
<DeleteSourcesSize>50</DeleteSourcesSize>
<MenuDestinations>_defaultdests_</MenuDestinations>
<Display>
</Display>
</Task>
<Task number="3">
<Name>Move</Name>
<MenuText>Move to</MenuText>
<MenuShow>true</MenuShow>
<MenuDestinations>_defaultdests_</MenuDestinations>
<Display>
</Display>
</Task>
<Task number="4">
<Name>Copy</Name>
<MenuText>Copy to</MenuText>
<MenuShow>true</MenuShow>
<MenuDestinations>_defaultdests_</MenuDestinations>
<Display>
</Display>
</Task>
<Task number="5">
<Name>Delete</Name>
<MenuText>Delete</MenuText>
<MenuShow>true</MenuShow>
<UseRecycleBin>false</UseRecycleBin>
<Display>
</Display>
</Task>
<!--
<Task number="100">
<Name>MyTask</Name>
<MenuText>MySend to</MenuText>
<MenuDestinations>_mydefaultdests_</MenuDestinations>
<CommandLine>myapp.exe %*</CommandLine>
<DeleteSources>false</DeleteSources>
<Display>
</Display>
</Task>
-->
</Tasks>
<Queues>
<Queue number="0">
<Name>MainTaskQueue</Name>
</Queue>
<Queue number="1">
<Name>RepairExtract</Name>
<MenuText>Repair then Extract</MenuText>
<MenuShow>true</MenuShow>
<MenuDestinations>_mydefaultdests_</MenuDestinations>
<QueueTask number="0">
<Name>Repair</Name>
<SetFilesToParent>true</SetFilesToParent>
</QueueTask>
<QueueTask number="1">
<Name>Extract</Name>
<GetFilesFromParent>true</GetFilesFromParent>
</QueueTask>
</Queue>
</Queues>
<DDE>
<Command number="0">
<Name>queue</Name>
<Exclusive>
<Extensions>Repair->Extensions, Extract->Extensions</Extensions>
</Exclusive>
</Command>
<Command number="1">
<Name>delete</Name>
<CommandTask>Delete</CommandTask>
</Command>
</DDE>