Search completed in 1.15 seconds.
13 results for "writestring":
writeString - Archive of obsolete content
To delete an existing value, supply null as the value parameter. ...
...To delete an existing value, supply null as the value parameter. Unlike the WritePrivateProfileString function, this method does not support using a null key to delete an entire section. Values are not actually written until performInstall is called. ...
...ng value, supply null as the value parameter. ...
Writing to Files - Archive of obsolete content
y several bytes if it has a value greater than 128. This encoding is done automatically as long as you specify the 'text' flag to nsIScriptableIO.newOutputStream(). Other character encodings are available; see Writing Other Character Encodings below for details about writing text in other encodings. There are several methods available to write to a stream. For text files, you will usually use the
writeString method. var file = IO.getFile("Desktop", "myinfo.txt"); var stream = IO.newOutputStream(file, "text"); stream.
writeString("This is some text"); stream.close(); In this example, a text input stream is created for the file 'myinfo.txt'. The
writeString method is called to write a single string to the file, supplied as an argument to the method. Finally, the stream is closed by calling the stream's...
...Writing Other Character Encodings The default character encoding is UTF-8. If you want to write using a different encoding, you can specify a third argument to nsIScriptableIO.newOutputStream() which specifies the encoding. This example opens a file using the UTF-16 encoding. ...
...ewOutputStream() which specifies the encoding. This example opens a file using the UTF-16 encoding. var stream = IO.newInputStream(file, "text", "UTF-16"); This third argument is not needed to write using UTF-8. As UTF-8 can store all characters, you will usually always use this default. For a list of supported character encodings, see Supported Character Sets. The files can be written using the
writeString method whichever character encoding is used. The difference is handled internally so you don't need to write any other part of the code differently. Writing Binary Data In addition to text, binary values may be written to a file either as bytes or as numbers. A number of methods are available which may be used for this. If you are going to write to a binary file instead of text, specify the 'bina...
nsIWindowsRegKey
Read only. key HKEY This attribute exposes the native HKEY and is available to provide C++ consumers with the flexibility of making other Windows registry API calls that are not exposed via t...
... integer contents of the named value. readStringValue() This method reads the string contents of the named value as a Unicode string. AString readStringValue( in AString name ); Parameters name The name of the value to query. This parameter can be the empty string to request the key's default value. Return value The string contents of the named value as a Unicode string. Note: Unlike
writeStringValue(), readStringValue() will work with REG_MULTI_SZ and REG_EXPAND_SZ types. Note: In Gecko 2.0, readStringValue() calls ExpandEnvironmentStrings() on a REG_EXPAND_SZ type. removeChild() This method removes a child key and all of its values. This method will fail if the key has any children of its own. void removeChild( in AString relPath ); Parameters relPath The relative path f...
... name The name of the value to modify. data The data for the value to modify. writeIntValue() This method writes the integer contents of the named value. The value will be created if it does not already exist. void writeIntValue( in AString name, in unsigned long data ); Parameters name The name of the value to modify. data The data for the value to modify.
writeStringValue() This method writes the unicode string contents of the named value. The value will be created if it does not already exist. void
writeStringValue( in AString name, in AString data ); Parameters name The name of the value to modify. This parameter can be the empty string to modify the key's default value. data The data for the value to modify. ...
Writing textual data - Archive of obsolete content
The example above passes 0 as the third argument, which disables buffering (Note: the implementation of the converter stream might not support buffering). Passing 0 ensures that da...
...am: var charset = "UTF-8"; // Can be any character encoding name that Mozilla supports var os = Components.classes["@mozilla.org/intl/converter-output-stream;1"] .createInstance(Components.interfaces.nsIConverterOutputStream); // This assumes that fos is the nsIOutputStream you want to write to os.init(fos, charset, 0, 0x0000); os.
writeString("Umlaute: \u00FC \u00E4\n"); os.
writeString("Hebrew: \u05D0 \u05D1\n"); // etc. os.close(); You can also write character arrays using the write function, although using
writeString is simpler from JavaScript code. The example above passes 0 as the third argument, which disables buffering (Note: the implementation of the converter stream might not support buffering). Passing 0 ensures that data will be immediately written to the underl...
nsIBinaryOutputStream
void setOutputStream( in nsIOutputStream aOutputStream ); Parameters aOutputStream Instance of the nsIOutputStream object to which output should be directed. write8() Writes an 8-bit integer to the stream. void write8(...
...eam. aLength The number of bytes to write to the stream. writeDouble() Writes a double precision floating point number to the stream. void writeDouble( in double aDouble ); Parameters aDouble The double to write to the stream. writeFloat() Writes a floating point number to the stream. void writeFloat( in float aFloat ); Parameters aFloat The floating point value to write to the stream.
writeStringZ() Writes an 8-bit pascal style string to the stream. The output data consists of a 32-bit length field, followed by that many 8-bit characters. void
writeStringZ( in string aString ); Parameters aString The string to write to the stream. writeUtf8Z() Writes an 8-bit pascal style string (UTF8-encoded) to the stream. The output data consists of a 32-bit length field, followed by that many 8-b...
File I/O - Archive of obsolete content
operation, // directly using "r" or "w" usually. // if you are sure there will never ever be any non-ascii text in data you can // also call foStream.write(data, data.length) directly var converter = Components.classes["@mozilla.org/intl/converter-output-stream;1"]. createInstance(Components.interfaces.nsIConverterOutputStream); converter.init(foStream, "UTF-8", 0, 0); converter.
writeString(data); converter.close(); // this closes foStream Note: The file status flags used in the nsIFileOutputStream.init() function are documented in PR_Open. For more information refer directly to nsprpub/pr/include/prio.h Writing a Binary File For example, here we can write PNG data to a file. // pngBinary already exists var aFile = Components.classes["@mozilla.org/file/local;1"]. cr...
Windows Install - Archive of obsolete content
var fRen8dot3Ini = getWinProfile(fTemp, "ren8dot3.ini"); var bIniCreated = false; var fLongFilePath; var sShortFilePath; if(fRen8dot3Ini != null) { for(i = 0; i < listLongFilePaths.length; i++) { fLongFilePath = getFolder(fProgram, listLongFilePaths[i]); sShortFilePath = File.windowsGetShortName(fLongFilePath); if(sShortFilePath) { fRen8dot3Ini.
writeString("rename", sShortFilePath, fLongFilePath); bIniCreated = true; } } if(bIniCreated) updateWinReg4Ren8dot3() ; } return(0); } // main var srDest; var err; var fProgram; srDest = 449; err = initInstall(prettyName, regName, "6.0.0.2000110801"); logComment("initInstall: " + err); fProgram = getFolder("Program"); logComment("fProgram: " + fProgram); if...
Methods - Archive of obsolete content
ll API. The majority of this API is now deprecated and as of Gecko 1.9 no longer available. Extension, Theme, and plug-in developers must switch away from install.js based packages to the new packaging scheme with an install.rdf manifest. In particular plugin developers should see how to package a plugin as an extension. Methods getString Retrieves a value from a .ini file.
writeString Changes a value in a .ini file. ...
WinProfile Object - Archive of obsolete content
n developers should see how to package a plugin as an extension. WinProfile (Windows only) Windows developers use this object to manipulate the content of a Windows .ini file. Overview This object does not have a public constructor. Instead, you construct an instance of this object by calling the getWinProfile method of the Install object. The two methods of the WinProfile object, getString and
writeString, allow you to read and write the data in the key/value pairs of a Windows .ini file. ...
XPInstall API reference - Archive of obsolete content
rRemove dirRename diskSpaceAvailable execute exists isDirectory isFile macAlias modDate modDateChanged move remove rename size windowsGetShortName windowsRegisterServer windowsShortcut WinProfile No properties Methods getString
writeString WinReg No properties Methods createKey deleteKey deleteValue enumKeys enumValueNames getValue getValueNumber getValueString isKeyWritable keyExists setRootKey setValue setValueNumber setValueString valueExists WinRegValue constructor Other...
Accessing the Windows Registry Using XPCOM
't forget that if you are writing a new value, you may need to create() the parent key first. This example demonstrates writing a new string value: var wrk = Components.classes["@mozilla.org/windows-registry-key;1"] .createInstance(Components.interfaces.nsIWindowsRegKey); wrk.create(wrk.ROOT_KEY_CURRENT_USER, "SOFTWARE\\MDC\\Test", wrk.ACCESS_WRITE); wrk.
writeStringValue("TestValue", "Hello World!"); wrk.close(); Checking the Existence of Keys and Values Before you attempt to read a value or open a child key, you should check to see whether it exists first. The nsIWindowsRegKey interface provides methods for both of these--hasValue() and hasChild()--as demonstrated in this example: var wrk = Components.classes["@mozilla.org/windows-registry-key;1"] ...
nsIScriptableIO
putStream object to use for writing the stream. Exceptions thrown NS_ERROR_INVALID_ARG aBase was null. ...