Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming

Reply
 
LinkBack Thread Tools
Old 07-12-09   #11 (permalink)
Case Modder
 
Spotswood's Avatar
 
Join Date: Jul 2008
Location: New Hampshire, USA
Posts: 236

Rep: 46 Spotswood is acknowledged by some
Unique Rep: 39
Trader Rating: 0
Default

Quote:
Originally Posted by Darkknight512 View Post
... which files am I supposed to put in the project...
From the tinyXML doc:
Quote:
Add tinyxml.cpp, tinyxml.h, tinyxmlerror.cpp, tinyxmlparser.cpp, tinystr.cpp, and tinystr.h to your project or make file. That's it! It should compile on any reasonably compliant C++ system. You do not need to enable exceptions or RTTI for TinyXML.
__________________
Rich
Custom Wooden Case Builder
Overclock.net Mod of the Month
Spotswood is offline   Reply With Quote
Old 07-12-09   #12 (permalink)
Overclocker
 
Darkknight512's Avatar
 
intel ati

Join Date: Apr 2008
Location: Toronto, Ontario
Posts: 1,587

Rep: 142 Darkknight512 is acknowledged by manyDarkknight512 is acknowledged by many
Unique Rep: 118
Trader Rating: 0
Default

Most of the XML parsers seems to be much more complex then I need it to be, is there something that would allow me to point to a value and read it in one line of code?

I figured out how to use an ini parser in minutes but I don't know enough to understand XML parsers...

This is what I had for ini files

Quote:
#include "stdafx.h"
#include "IniFile.h"
#include <string>
#include <vector>
#include <iostream>

std::string FileName = "test.ini";
int s;

using namespace std;

int main()
{
// Creat the ini file
CIniFile::Create(FileName);

// Create a Section called Section1, and a key/value of IP=127.0.0.1
CIniFile::SetValue("IP","127.0.0.1","Section 1",FileName);

// Get the value of IP in section Section1 and store it in s
int s = CIniFile::GetValue("IP","Section 1",FileName);
cout << s << endl;
system("pause");

return 0;
}
I just need something similar to and ini files but let me divide sections into subsections, load the file, read and write values to the file, and save it.

I don't know a lot right now and this is just confusing me.

System: X-Caliber
CPU
Intel Core 2 Duo E4600 @3.0 Ghz
Motherboard
Gigabyte P35 DS3L
Memory
3gb 533 mhz DDR2 (Dual Channel) @560 Mhz
Graphics Card
ATI Radeon HD3850 512MB 720/950
Hard Drive
160 Hitachi HDD
Sound Card
Intergrated 5.1 Audio (Realtek ACL888)
Power Supply
460 watt Coolermaster
Case
Coolermaster Elite
CPU cooling
Stock (MX-2)
GPU cooling
Stock - (Fan Speed [%] = Temp [C]) - Load 70C
OS
Windows Vista - Ultimate (x86)
Monitor
LG E700B 17" CRT

Last edited by Darkknight512 : 07-13-09 at 04:41 PM
Darkknight512 is offline   Reply With Quote
Old 07-13-09   #13 (permalink)
Overclocker
 
Darkknight512's Avatar
 
intel ati

Join Date: Apr 2008
Location: Toronto, Ontario
Posts: 1,587

Rep: 142 Darkknight512 is acknowledged by manyDarkknight512 is acknowledged by many
Unique Rep: 118
Trader Rating: 0
Default

Anyone?

System: X-Caliber
CPU
Intel Core 2 Duo E4600 @3.0 Ghz
Motherboard
Gigabyte P35 DS3L
Memory
3gb 533 mhz DDR2 (Dual Channel) @560 Mhz
Graphics Card
ATI Radeon HD3850 512MB 720/950
Hard Drive
160 Hitachi HDD
Sound Card
Intergrated 5.1 Audio (Realtek ACL888)
Power Supply
460 watt Coolermaster
Case
Coolermaster Elite
CPU cooling
Stock (MX-2)
GPU cooling
Stock - (Fan Speed [%] = Temp [C]) - Load 70C
OS
Windows Vista - Ultimate (x86)
Monitor
LG E700B 17" CRT
Darkknight512 is offline   Reply With Quote
Old 07-18-09   #14 (permalink)
NEEDZ MOAR PPD
 
H3||scr3am's Avatar
 
intel nvidia

Join Date: Mar 2007
Location: Cambridge, Ontario
Posts: 6,937

Folding Team Rank: 33
Team Name: Nom Nom Nom PPD
Trader Rating: 21
Default

from BeatifulSoup load BeautifulStoneSoup as BS

this is python, don't know what language you're working in here...

basically, use BS to parse through the XML file, it may be a bit confusing, but its very powerful, and can do alot of things...

then you can print out to files as needed... and store loacally and just have it overwrite or catenate to the files each time it loads?
__________________

I am 91% addicted to Counterstrike. What about you?
OCN CS:S GG: overclock.nuclearfallout.net:27015
OCN TF2: 68.232.173.130:27015 BRAND NEW 500FPS!!!
My Role in this community is to make your gaming experience on our gameservers enjoyable
please feel free to PM me with your suggestions and issues.

System: B3 Holds me back :(
CPU
Intel Q6600 (L664G)
Motherboard
Asus P5K Deluxe
Memory
G.Skill 2GB HZs & 2GB Ballistix
Graphics Card
eVGA 8800GTX / XFX 8800GS
Hard Drive
WD SATA HD 250GB
Sound Card
Auzentech X-Fi Prelude
Power Supply
Silverstone Decathlon 750W
Case
TT Armor w/ 25cm side fan
CPU cooling
D-Tek FuZion WB
GPU cooling
DD 8800GTX WB / Stock
OS
XP pro SP3 :D
Monitor
2x 19" LG LCDs
Overclock.net - 2009 Chimp Challenge Champions 5 Million+ Folding at Home points
H3||scr3am is offline I fold for Overclock.net Overclocked Account H3||scr3am's Gallery   Reply With Quote
Old 08-14-09   #15 (permalink)
Evo
Overclocker
 
intel nvidia

Join Date: Dec 2005
Location: Gold Coast,QLD
Posts: 208

Rep: 4 Evo Unknown
Unique Rep: 4
Trader Rating: 0
Default

Hi Darkknight,

I strongly recommend if your going to be parsing XML data using TinyXML, i've used it for countless games i've made its probably the best libary out there for c++ and there is a non stl version which is awesome if your console programing.

Code:
<Level name="levelname">
      <monster>
           <monster name="" type=""  hp="" x="" y""/>
           <monster name="" type=""  hp="" x="" y""/>
           <monster name="" type=""  hp="" x="" y""/>
           <monster name="" type=""  hp="" x="" y""/>
     </monster>
     <item>
           <item name="" x="" y"">
     </item>
</Level>
__________________
Macbook|2ghz|2gigRam|Dvd Burn|MacOSX 10.4.10 1.1v

System: Uber Gamer
CPU
Intel E6600 @ 3ghz
Motherboard
ASUS P5W DH DELUXE
Memory
G.Skill 800mhz 4.4 - 4GB
Graphics Card
XFX 280GTX
Hard Drive
2x WD 250 Raid0/WD 250g/WD 120g/Seagate 320g
Sound Card
Realtek AC'97/Logi Z-5450
Power Supply
Thermaltake Tough Power 750Watts
Case
Thermaltake Shark
CPU cooling
ThermalTake BigTyphoon Lapped and FM121
GPU cooling
Stock
OS
Windows Vista 64bit
Monitor
ASUS 22" 2MS
Evo is offline   Reply With Quote
Old 08-14-09   #16 (permalink)
Evo
Overclocker
 
intel nvidia

Join Date: Dec 2005
Location: Gold Coast,QLD
Posts: 208

Rep: 4 Evo Unknown
Unique Rep: 4
Trader Rating: 0
Default

oh forgot here is a some code on how to use tinyxml if your stuck

keep in mind this is off the top of my head

Code:
TiXmlDocument *xmlDoc; //this will hold your file that needs to be past
TiXmlElement *xmlRoot, *xmlNodes; //xml file structure

xmlDoc = new TiXmlDocument(); //dynamicly create a object of TIXMLDocument on the heap
xmlDoc->Parse(/*File*/);

xmlNodes = xmlRoot->FirstChildElement("monster");

if(xmlNodes) // read into the file
{
       TiXmlElement *xmlMonster, *xmlItem;
       
       std::string monsterName = xmlNode->Attribute("name");
       std::string type = xmlNode->Attribute("type");
       Vector2 tempV;
       tempV.x = xmlNode->Attribute("x");
       tempV/y = xmlNode->Attribute("y");

}

delete xmlDoc; //Clean up the object off the heap, "close the file"
__________________
Macbook|2ghz|2gigRam|Dvd Burn|MacOSX 10.4.10 1.1v

System: Uber Gamer
CPU
Intel E6600 @ 3ghz
Motherboard
ASUS P5W DH DELUXE
Memory
G.Skill 800mhz 4.4 - 4GB
Graphics Card
XFX 280GTX
Hard Drive
2x WD 250 Raid0/WD 250g/WD 120g/Seagate 320g
Sound Card
Realtek AC'97/Logi Z-5450
Power Supply
Thermaltake Tough Power 750Watts
Case
Thermaltake Shark
CPU cooling
ThermalTake BigTyphoon Lapped and FM121
GPU cooling
Stock
OS
Windows Vista 64bit
Monitor
ASUS 22" 2MS
Evo is offline   Reply With Quote
Old 08-14-09   #17 (permalink)
Overclocker
 
Darkknight512's Avatar
 
intel ati

Join Date: Apr 2008
Location: Toronto, Ontario
Posts: 1,587

Rep: 142 Darkknight512 is acknowledged by manyDarkknight512 is acknowledged by many
Unique Rep: 118
Trader Rating: 0
Default

Thank's I'll look into that when I got some free time, been a little busy the past week.

System: X-Caliber
CPU
Intel Core 2 Duo E4600 @3.0 Ghz
Motherboard
Gigabyte P35 DS3L
Memory
3gb 533 mhz DDR2 (Dual Channel) @560 Mhz
Graphics Card
ATI Radeon HD3850 512MB 720/950
Hard Drive
160 Hitachi HDD
Sound Card
Intergrated 5.1 Audio (Realtek ACL888)
Power Supply
460 watt Coolermaster
Case
Coolermaster Elite
CPU cooling
Stock (MX-2)
GPU cooling
Stock - (Fan Speed [%] = Temp [C]) - Load 70C
OS
Windows Vista - Ultimate (x86)
Monitor
LG E700B 17" CRT
Darkknight512 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -5. The time now is 10:45 PM.


Overclock.net is a Carbon Neutral Site Creative Commons License

Terms of Service / Forum Rules | Privacy Policy | DMCA Info | Advertising | Become an Official Vendor
Copyright © 2009 Shogun Interactive Development. Most rights reserved.
Page generated in 0.13759 seconds with 8 queries