MonobjcMonobjc Documented Class Library
StringWithContentsOfFileUsedEncodingError Method (path, enc, error)
NamespacesMonobjc.FoundationNSStringStringWithContentsOfFileUsedEncodingError(NSString, NSStringEncoding%, NSError%)

Returns a string created by reading data from the file at a given path and returns by reference the encoding used to interpret the file.

Original signature is '+ (id)stringWithContentsOfFile:(NSString *)path usedEncoding:(NSStringEncoding *)enc error:(NSError **)error'

Available in Mac OS X v10.4 and later.

Declaration Syntax
C#Visual BasicVisual C++
public static NSString StringWithContentsOfFileUsedEncodingError(
	NSString path,
	out NSStringEncoding enc,
	out NSError error
)
Public Shared Function StringWithContentsOfFileUsedEncodingError ( _
	path As NSString, _
	<OutAttribute> ByRef enc As NSStringEncoding, _
	<OutAttribute> ByRef error As NSError _
) As NSString
public:
static NSString^ StringWithContentsOfFileUsedEncodingError(
	NSString^ path, 
	[OutAttribute] NSStringEncoding% enc, 
	[OutAttribute] NSError^% error
)
Parameters
path (NSString)
A path to a file.
enc (NSStringEncoding%)
Upon return, if the file is read successfully, contains the encoding used to interpret the file at path.
error (NSError%)
If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.
Return Value
A string created by reading data from the file named by path. If the file can’t be opened or there is an encoding error, returns nil.
Version Information
  • Available in Monobjc Bridge: 10.6 (For Mac OS X 10.6 and later), 10.5 (For Mac OS X 10.5 and later)

Assembly: Monobjc.Foundation (Module: Monobjc.Foundation)