Project WIFE

An INI File Parser

Page 1 of 1

13 Replies - 1005 Views - Last Post: 06 February 2010 - 09:26 AM

#1 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 1948
  • View blog
  • Posts: 8,661
  • Joined: 29-May 08

Project WIFE

Posted 12 January 2010 - 08:43 AM

CodeName: Project WIFE
Purpose: Make handling INI Files simpler.

To Do List:
Create specific Exception Classes and alter the code to use them.
Update Error Handling
Saving of INI Files.
Add Comments.
Create Codeplex Site
Release Status:
A beta version to be release after completing To Do List.
Help Need:
I hope most helpful if you could post (inside of code tags) Examples of INI Files so I can for test and refine the parser.

Is This A Good Question/Topic? 0
  • +

Replies To: Project WIFE

#2 Core  Icon User is offline

  • using System.Linq;
  • member icon

Reputation: 764
  • View blog
  • Posts: 5,095
  • Joined: 08-December 08

Re: Project WIFE

Posted 12 January 2010 - 09:32 AM

This is a good idea, since by default there is no INI parsing functionality included in .NET. But what about the fact that INI is now being replaced by XML? Just a thought.
Was This Post Helpful? 0
  • +
  • -

#3 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 1948
  • View blog
  • Posts: 8,661
  • Joined: 29-May 08

Re: Project WIFE

Posted 12 January 2010 - 09:57 AM

There are other places it can used
It could be used to parse .url files (Internet Shortcuts)

Example .url
[InternetShortcut]
URL=http://www.someaddress.com/
WorkingDirectory=C:\WINDOWS\
ShowCommand=7
IconIndex=1
IconFile=C:\WINDOWS\SYSTEM\url.dll
Modified=20F06BA06D07BD014D
HotKey=1601



Using Project WIFE to Load, Parse, Comment and Save.
' Create a new instance of INI from a file, using the Default parsing options Comment # , Assignment =
Dim myINI As New INI(INIConfig.Default,"<File Path>",True)
Console.WriteLine(myINI("InternetShortcut")("URL").Value)
' Prints out http://www.someaddress.com/

myINI("InternetShortcut")("URL")="http://www.someotheraddress.com/")
myINI("InternetShortcut")("URL").Comment=" This is a comment about the URL"
' Changes the url
myINI.Save("") 'Save



Future Ideas.
Parameter Arrays
Importing and Exporting the INI as a simple XML File is a possible addition.
Was This Post Helpful? 0
  • +
  • -

#4 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 1948
  • View blog
  • Posts: 8,661
  • Joined: 29-May 08

Re: Project WIFE

Posted 12 January 2010 - 10:11 AM

Codeplex Site: Project WIFE
No code up yet.
Was This Post Helpful? 0
  • +
  • -

#5 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 1948
  • View blog
  • Posts: 8,661
  • Joined: 29-May 08

Re: Project WIFE

Posted 12 January 2010 - 12:44 PM

Site up a running.
Was This Post Helpful? 0
  • +
  • -

#6 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 1948
  • View blog
  • Posts: 8,661
  • Joined: 29-May 08

Re: Project WIFE

Posted 13 January 2010 - 03:33 PM

Added some new functionality and documentaton to ProjectWIFE.
Was This Post Helpful? 0
  • +
  • -

#7 Tom9729  Icon User is offline

  • Segmentation fault
  • member icon

Reputation: 178
  • View blog
  • Posts: 2,636
  • Joined: 30-December 07

Re: Project WIFE

Posted 13 January 2010 - 06:23 PM

View PostCore, on 12 Jan, 2010 - 11:32 AM, said:

This is a good idea, since by default there is no INI parsing functionality included in .NET. But what about the fact that INI is now being replaced by XML? Just a thought.

The problem with XML is that people use it for things that really don't need it (totally guilty on this one). INI is nice and simple in comparison and is more than enough for most projects. :)
Was This Post Helpful? 0
  • +
  • -

#8 NeoTifa  Icon User is offline

  • ¿Dónde están mis pantalones?
  • member icon





Reputation: 1968
  • View blog
  • Posts: 14,472
  • Joined: 24-September 08

Re: Project WIFE

Posted 14 January 2010 - 11:26 AM

Oh, I thought this was something similar to project Aiko. XD
Was This Post Helpful? 0
  • +
  • -

#9 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 1948
  • View blog
  • Posts: 8,661
  • Joined: 29-May 08

Re: Project WIFE

Posted 17 January 2010 - 10:08 AM

VB Developer Center
Attached Image
Owned
Was This Post Helpful? 0
  • +
  • -

#10 olibenu  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 45
  • View blog
  • Posts: 536
  • Joined: 31-December 08

Re: Project WIFE

Posted 05 February 2010 - 07:17 AM

why WIFE? acronym?
Was This Post Helpful? 0
  • +
  • -

#11 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 1948
  • View blog
  • Posts: 8,661
  • Joined: 29-May 08

Re: Project WIFE

Posted 05 February 2010 - 08:06 AM

There is one but I can't think what it is. :D I do remember I stood for INI and F stood for file.

I'm thinking and liking.
Project Where INI Files are Easy
Was This Post Helpful? 0
  • +
  • -

#12 myork  Icon User is offline

  • D.I.C Head

Reputation: 41
  • View blog
  • Posts: 129
  • Joined: 04-March 09

Re: Project WIFE

Posted 05 February 2010 - 04:14 PM

I've run into problems with these permutations of the same ini file:

[Base]
 map=Resources\GISDat\Boundry_Lines.shp



[Base]
 map=Resources\GISDat\BoundryLines.shp



[Base]
 map=Resources\GISDat\Boundry_Lines



It seems as though if there can't be a "." or a "_" in the lines. Is this really the case? I can't even make your example work while looking for ("InternetShortcut")("IconFile")
Was This Post Helpful? 0
  • +
  • -

#13 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 1948
  • View blog
  • Posts: 8,661
  • Joined: 29-May 08

Re: Project WIFE

Posted 06 February 2010 - 03:28 AM

Thank you for the bug report.
The example was used to answer Core question about what it be used for.
Bear in mind the project was fairly young at the time.

The parser has a rule to determine what parameter is, it include allowed characters. : . _ were missing so I've add them in.
I need to add a section to the documentation covering the currently allowed characters.

Watch out for an update some time today.
Was This Post Helpful? 0
  • +
  • -

#14 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 1948
  • View blog
  • Posts: 8,661
  • Joined: 29-May 08

Re: Project WIFE

Posted 06 February 2010 - 09:26 AM

There a new release available at the codeplex site.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1