ini

c++ boost library - writing to ini file without overwriting?

假如想象 提交于 2019-12-07 03:11:27
im trying to write an ini file using boost library's ini parser and property tree. The file is written in stages - i mean every function writes a portion of it. At the end im left with only the last output instead of having everything written down. Sample code i use while writing: property_tree::ptree pt; string juncs=roadID; size_t pos = juncs.find_last_of("j"); string jstart = juncs.substr(0,pos); string jend = juncs.substr(pos,juncs.length()); pt.add(repID + ".startJunction", jstart); pt.add(repID + ".endJunction", jend); write_ini("Report.ini", pt); How can i use the write_ini function

Changing an icon's folder by modifying desktop.ini

六月ゝ 毕业季﹏ 提交于 2019-12-06 10:28:09
问题 My goal is to change every folder's icon of my movie library to an icon I have for every folder in Windows using Java. Every folder has a 256x256 icon in it named after the folder but with the appropriate extension. For example the folder called 5cm Per Second has the file 5cm Per Second.ico in it. I figured I could do this by modifying the desktop.ini file in the folder. All the folders have that file in them because the icons inside each folder used to be the actual icon of the folder, but

INI file - retrieve a section name by key name in VBS

China☆狼群 提交于 2019-12-06 09:17:48
I would like to retrieve a section name from an INI file with only a unique key name My ini file : ... [Area.104] Title=Central North America Local=Scenery\NAMC Layer=104 Active=TRUE Required=FALSE [Area.105] Title=Eastern North America Local=Scenery\NAME Layer=105 Active=TRUE Required=FALSE [Area.106] Title=Western North America Local=Scenery\NAMW Layer=106 Active=TRUE Required=FALSE ... How can I get section name [Area.105] from unique key Title=Eastern North America ??? Thank you I have two ways of finding the required Area code: METHOD 1 Option Explicit Dim strFilePath, ofso, ofile,

How to read multiline values in inifile

北城以北 提交于 2019-12-06 09:06:34
I am trying to use a multi line value as specified as list in ini file, I was able to read sections but not able read to multi line values from a given key. I have tried to using list manner it completely failed. # Ini file [UNITS] COMPARE_UNITS = [list [11871000 118700] [1198100 1198100] ] [VARS] OLD_REL = 4.3 NEW_REL = 4.5 I have tried to using string based format also i failed but i could able to read sections and first line of a given key value. # Ini file [UNITS] COMPARE_UNITS = " 11871000 118700 1198100 1198100 " [VARS] OLD_REL = 4.3 NEW_REL = 4.5 When i tried to get key values it

How to preserve application.ini paths using Zend_Config_Writer_Ini

徘徊边缘 提交于 2019-12-06 08:07:20
问题 I'm currently working on a build system in Phing that takes a Zend Framework project template and configures it according to Phing parameters. One problem that I've come across is when using Zend_Config_Writer_Ini. My Phing task takes a pre-populated file from the repo called application.default.ini and modifies this using Zend_Config_Ini to add parameters from the build file (db details, etc). It then writes it to application.ini ready for the project to use. A simplified version of the

How to read and write .ini files using boost library [duplicate]

可紊 提交于 2019-12-06 07:12:34
问题 This question already has answers here : How to parse ini file with Boost (4 answers) Closed 6 years ago . How to read and write (or modify) .ini files using boost library? 回答1: With Boost.PropertyTree you can read and update the tree, then write to a file (see load and save functions. Have a look at How to access data in property tree. You can definitely add new property or update existing one. It mentiones that there's erase on container as well so you should be able to delete existing

Read ini file which does not have any section?

本秂侑毒 提交于 2019-12-06 03:49:35
My ini file does not have any section. It has following data com.ibm.rcp.toolbox.admin/toolboxvisibleChild=false com.ibm.collaboration.realtime.community/defaultAuthType=ST-DOMINO-SSO com.ibm.collaboration.realtime.brokerbridge/startBroker=false com.ibm.collaboration.realtime.webapi/startWebContainer=true I want to use function. [DllImport("kernel32")] private static extern int GetPrivateProfileString(string section, string key,string def, StringBuilder retVal, int size,string filePath); My problems I cannot give section name in the function because I dont have any If I give section name null,

Modifying ini files using shell script

隐身守侯 提交于 2019-12-06 03:36:05
问题 I have an ini file similar to this [test] foo=bar and if we call this ini file as test1.ini How do I change the value of foo to foobarbaz for example using shell script . I have tried the following and it doesn't work for me. I don't see the updated changes in the ini file. how do I write it? sed "/^foo=/s/=.*/=foobarbaz/" < test1.ini Do you have any other suggestions 回答1: To have the file updated, use the -i option of sed: sed -i "/^foo=/s/=.*/=foobarbaz/" test1.ini From man sed : - i[SUFFIX

enable xdebug on bluehost shared server

被刻印的时光 ゝ 提交于 2019-12-05 20:08:57
I want to setup phpunit on a demo site on a bluehost shared server. I want to check if the php codes work on the environment after I made modifications and added more components. With this, I need to set up xdebug. The problem is that my account is not allowed to download and install xdebug, I got permission denied. pecl install xdebug Then I read upon an answer here Xdebug for remote server not connecting . What I did is upload the xdebug.so file from my local, copy the /etc/php.ini to the server's public_html directory, and edited the php.ini file and and added the line below to refer to the

Regex to match ini value

空扰寡人 提交于 2019-12-05 19:17:12
I'm trying to match the last name of a value of an ini line. foo.bar.far.boo = "some value" I can match 'boo =' but I just need 'boo' I do (\w+)\s*= but it matches the equal signs, but I don't want it to be matched. By the way, I should be able to get if there is no sub values like : foo = "value" Use \w+(?=\s*=) (?=...) is a positive lookahead assertion , meaning "assert that the enclosed regex can be matched here, but don't make it part of the match itself". So the regex matches one or more alphanumeric characters if and only if they are followed by (optional whitespace and) an equals sign.