Hi!
this is template for fast creating file conversion utilities. Contains needed set to parse commandline, open files, read symbol, write symbol, close files. You need mostly just to insert your processing code between read and write.
designed as template for WinAsm, but not depends to IDE.
package has also tab2spaces converter can be used as example
Enjoy!

parsecmdline procedure:
- tab in beginnig of command line not checked
- quoted path should be imho returned without quotes
- you should warn caller that passed command line string will get overwritten
- something like abcd"abcd" is considered as one argument abcd"abcd (without ending quote), and abcd"abcd"1234 becomes two arguments: abcd"abcd and 1234.

so... it's not THAT simple.

combined strings:
- dynamic allocated strings really should have size and buffer size stored and used. More work needed here

thanks!
- tabs in commandline - never met them, but possible to change
- parser returns not pathes, but parameters divided with spaces
- warning - ok
- lost of end quote: bug, will be fixed
i decided to return aaa"bbb" as separate parameter for case like
/o:"c:\my docs\out.txt"

-tabs in commandline: i already forgot check well, there is this code:

Code:

cmp al,9
jne .not_tab
mov al,20h
.not_tab:

to treat tabs as spaces - does not it help?
=======
at the beginning!! understand!! - will be fixed - it is because first time i decided do not check for tabs in commandline, but then decided to check, but forgot to do thia in all places. thanks!
=======
fixed uploaded

Last edited by shoorick on 09 Feb 2007, 13:50; edited 2 times in total

1.you possibly missguided with "search_end" lablel ^) - it is not end of search, it is search of end of the parameter
2.in dynamic string, current and max length is a MUST-HAVE >
you right. but combstr macros is not universal solution. it is fast solution for cases when you do know what you do. although these macros do not check end of buffer, they can be mixed with checking code when you unsure - edi has current position in buffer, top of stack - pointer to first byte beyound end of buffer, [esp]-edi - free space left. look at cs_test example in shoolib - it is used there.
i've been thinking about checking macros - the matter is free time, possible in future

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum