Samond Classes Library 1.1.6-RELEASE build 132
Public Member Functions

SCConfigFile Class Reference

Config files support class. More...

#import <SCConfigFile.h>

Inheritance diagram for SCConfigFile:
SCConfig SCObject <SCDictionaryObjectProtocol> <SCCodingProtocol> <SCStreamProtocol> <SCCollectionProtocol>

List of all members.

Public Member Functions

(void) - setLoaded: [implementation]
Getting and Setting Configuration Properties
(BOOL) - isLoaded
(NSString *) - description
(NSString *) - path
(NSString *) - commentPrefix
(SCStrings *) - comments
(void) - setPath:
(void) - setCommentPrefix:
(void) - setComments:
Setting and Copying Configurations
(void) - setConfigFile:
(void) - setConfigFileWithText:
(void) - setConfigFileWithPath:
(void) - setConfigFileWithStream:
Converting Configurations
(SCConfig *) - config
Add Values from Existing Configurations
(void) - addValuesFromConfigFile:
(void) - addValuesFromConfigFileWithPath:
(void) - addValuesFromStream:
Configuration File Reading and Writing
(void) - read
(void) - readConfigFileWithPath:
(void) - readConfigFileFromText:
(void) - readConfigFileFromStream:
(void) - reload
(void) - writeConfigFileWithPath:
(void) - writeConfigFileToText:
(void) - writeConfigFileToStream:
(void) - appendConfigFileToPath:
(void) - appendConfigFileToText:
(void) - appendConfigFileToStream:
Configuration File Comments Control
(BOOL) - isComment:
(void) - addAllowedComment:
(void) - removeAllowedComment:
(SCArray *) - allowedComments
(void) - removeAllowedComments
(BOOL) - haveComments
(void) - addComment:
(void) - addComments:
(void) - setComment:
(void) - removeComment:
(void) - removeComments
(void) - replaceComment:withComment:
(SCStrings *) - commentsForKey:
(BOOL) - haveCommentsForKey:
(void) - addComment:forKey:
(void) - addComments:forKey:
(void) - setComment:forKey:
(void) - setComments:forKey:
(void) - removeComment:forKey:
(void) - removeCommentsForKey:
(void) - replaceComment:withComment:forKey:
Additional methods
(void) - resetConfigurationFile

Creating and Initializing Configurations

(SCConfigFile *) + configFileWithCoder:
(SCConfigFile *) + configFileWithContentsOfSerializedFile:
(SCConfigFile *) + configFileWithDataDictionary:
(SCConfigFile *) + configFileWithDataDictionaryFromFile:
(SCConfigFile *) + configFileWithStream:
(SCConfigFile *) + configFileWithFileStream:
(SCConfigFile *) + configFileWithConfig:
(SCConfigFile *) + configFileWithConfigFile:
(SCConfigFile *) + configFile
(id) - initWithConfigFile:

Detailed Description

Config files support class.

Class implements the functions for using the text configuration files.
Class was introduced in version 1.2.0.

Class declares the following properties:


Member Function Documentation

- (void) addAllowedComment: (NSString *)  comment

Adds the specified string to the allowed comments list.

Parameters:
comment- added comment string
- (void) addComment: (NSString *)  comment

Adds the specified string to the configuration file comments list.

Parameters:
comment- added string
Exceptions:
SCConfigException- configuration file error detected
- (void) addComment: (NSString *)  comment
forKey: (NSString *)  key 

Adds the specified string to the comments list of a given configuration key.

Parameters:
comment- added string
key- key for which adding comment
Exceptions:
SCConfigException- configuration file error detected
- (void) addComments: (SCStrings *)  comments

Adds the strings from a given strings list into the receiving configuration file comments.

Parameters:
comments- strings list with the added comments
Exceptions:
SCConfigException- configuration file error detected
- (void) addComments: (SCStrings *)  comments
forKey: (NSString *)  key 

Adds strings from the specified list into the comments for a given key.

Parameters:
comments- list with the added comment strings
key- configuration key for which to adding comments
Exceptions:
SCConfigException- configuration file error detected
- (void) addValuesFromConfigFile: (SCConfigFile *)  configFile

Adds into the receiving configuration file values from the specified configuration file.

Parameters:
configFile- existing source configuration file
Exceptions:
SCConfigException- configurstion file error detected
- (void) addValuesFromConfigFileWithPath: (NSString *)  path

Adds into the receiving configuration file values from the file with the specified path.

Parameters:
path- source file path
Exceptions:
SCConfigException- configuration file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) addValuesFromStream: (SCStream *)  stream

Adds into the receiving configuration file values from the specified stream.

Parameters:
stream- input stream
Exceptions:
SCConfigException- configuration file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCArray *) allowedComments

Returns the allowed comments list.

Returns:
Allowed comments list
- (void) appendConfigFileToPath: (NSString *)  path

Appends the receiving configuration file content into the file with the specified path.

Parameters:
path- output file path
Exceptions:
SCConfigException- configuration file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected

!!

- (void) appendConfigFileToStream: (SCStream *)  stream

Appends the receiving configuration file content into the specified stream.

Parameters:
stream- destination output stream
Exceptions:
SCConfigException- configuration file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) appendConfigFileToText: (SCStrings *)  text

Appends the receiving configuration file content into the specified strings list.

Parameters:
text- destination strings list
Exceptions:
SCConfigException- configuration file error detected
SCTextException- strings list error detected
- (NSString *) commentPrefix

Returns a string with the comment prefix.

Returns:
Comment prefix
- (SCStrings *) comments

Returns the receiving configuration file comments.

Returns:
Configuration file comments
- (SCStrings *) commentsForKey: (NSString *)  key

Returns a comments for the specified configuration key.

Parameters:
key- configuration key for which to return the comments
Returns:
Configuration key comments or nil if the specified key is not found
Exceptions:
SCConfigException- configuration file error detected
- (SCConfig *) config

Returns a configuration with the copy of all receiving configuration file keys and settings.

Returns:
Configuration with the required keys and settings

Reimplemented from SCConfig.

+ (SCConfigFile *) configFile

Returns the configuration file created by using the default properties.

Returns:
A created configuration file
+ (SCConfigFile *) configFileWithCoder: (NSCoder *)  coder

Returns the configuration file created by using the specified coder.

Parameters:
coder- source coder
Returns:
A created confgiration file
+ (SCConfigFile *) configFileWithConfig: (SCConfig *)  config

Returns the configuration file created by using the specified existing configuration.

Parameters:
config- existing source configuration
Returns:
A created configuration file
Exceptions:
SCConfigException- configuration error detected
+ (SCConfigFile *) configFileWithConfigFile: (SCConfigFile *)  configFile

Returns the configuration file created by using the specified existing configuration file.

Parameters:
configFile- existing source configuration file
Returns:
A created configuration file
Exceptions:
SCConfigException- configuration error detected
+ (SCConfigFile *) configFileWithContentsOfSerializedFile: (NSString *)  path

Returns the configuration file created by using the contents of serialized file with the specified path.

Parameters:
path- source serialized file path
Returns:
A created configuration file
+ (SCConfigFile *) configFileWithDataDictionary: (NSDictionary *)  dictionary

Returns the configuration file created by using the specified dictionary.

Parameters:
dictionary- source dictionary
Returns:
A created configuration file
+ (SCConfigFile *) configFileWithDataDictionaryFromFile: (NSString *)  path

Returns the configuration file created by using the dictionary from the specified file.

Parameters:
path- source dictionary file path
Returns:
A created configuration file
+ (SCConfigFile *) configFileWithFileStream: (NSString *)  path

Returns the configuration file created from the stream file with the specified path.

Parameters:
path- stream file path
Returns:
A created configuration file
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
+ (SCConfigFile *) configFileWithStream: (SCStream *)  stream

Returns the configuration file created from the specified stream.

Parameters:
stream- stream for reading configuration file
Returns:
A created configuration file
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (NSString *) description

Returns a string which represents the configuration file information.

Returns:
Configuration file description string

Reimplemented from SCConfig.

- (BOOL) haveComments

Returns a boolean which determines whether the receiving configuration file has at least one comment.

Returns:
YES if the receiving configuration file has at least one comment, otherwise NO
- (BOOL) haveCommentsForKey: (NSString *)  key

Returns a boolean which determines whether the receiving configuration file has at least one comment for the record with the specified key.

Parameters:
key- required configuration record key
Returns:
YES if the record with the specified key has at least one comment, otherwise NO
- (id) initWithConfigFile: (SCConfigFile *)  configFile

Initializes the configuration file using the specified existing configuration file.

Parameters:
configFile- existing source configuration file
Returns:
A newly initialized configuration file
Exceptions:
SCConfigException- configuration file error detected
- (BOOL) isComment: (NSString *)  string

Returns a boolean value that determines whether the specified string is a comment line.

Parameters:
string- checked string
Returns:
YES if the specified string is a comment line, otherwise NO
- (BOOL) isLoaded

Returns a boolean that determines whether the configuration file is loaded.

Returns:
YES if the configurstion file is loaded, otherwise NO
- (NSString *) path

Returns the receiving configuration file path.

Returns:
Configuration file path
- (void) read

Reads the content of the default configuration file.

Exceptions:
SCConfigException- configuration file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) readConfigFileFromStream: (SCStream *)  stream

Reads the content of the specified stream into the receiving configuration file.

Parameters:
stream- input stream
Exceptions:
SCConfigException- configuration file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) readConfigFileFromText: (SCStrings *)  text

Reads the content of the specified strings list into the receiving configuration file.

Parameters:
text- source strings list
Exceptions:
SCConfigException- configuration file error detected
- (void) readConfigFileWithPath: (NSString *)  path

Reads the content of the file with the specified path into the receiving configuration file.

Parameters:
path- source file path
Exceptions:
SCConfigException- configuration file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) reload

Discards all changes in the configuration file and reads content from the default file.

Exceptions:
SCConfigException- configuration file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) removeAllowedComment: (NSString *)  comment

Removes the specified string from the allowed comments list.

Parameters:
comment- removed comment string
- (void) removeAllowedComments

Removes all records from the allowed comments list.

- (void) removeComment: (NSString *)  comment

Removes from the receiving configuration file comments the specified string.

Parameters:
comment- removed comment string
Exceptions:
SCConfigException- configuration file error detected
- (void) removeComment: (NSString *)  comment
forKey: (NSString *)  key 

Removes a given string from the comments of the specified key.

Parameters:
comment- removed comment string
key- key for which to be removed comment string
Exceptions:
SCConfigException- configuration file error detected
- (void) removeComments

Removes all comments from the receiving configuration file.

Exceptions:
SCConfigException- configuration file error detected
- (void) removeCommentsForKey: (NSString *)  key

Removes comments for the specified configuration key.

Parameters:
key- key for which to be removed comments
Exceptions:
SCConfigException- configuration file error detected
- (void) replaceComment: (NSString *)  comment
withComment: (NSString *)  newComment 

Replaces the specified comment with a given comment.

Parameters:
comment- replaced existing comment
newComment- new comment string
Exceptions:
SCConfigException- configuration file error detected
- (void) replaceComment: (NSString *)  comment
withComment: (NSString *)  newComment
forKey: (NSString *)  key 

Replaces the specified comment string for a given configuration key by using the specified new comment string.

Parameters:
comment- string to be replaced
newComment- new comment string
key- configuration key for which to be replaced comment string
Exceptions:
SCConfigException- configuration file error detected
- (void) resetConfigurationFile

Remove all configuration file records, clears the configuration service lists and sets the properties to the default values (excluding delegate object).

Exceptions:
SCConfigException- configuration error detected
- (void) setComment: (NSString *)  comment

Replaces the receiving configuration file comments by using the specified comment string.

Parameters:
comment- new comment string
Exceptions:
SCConfigException- configuration file error detected
- (void) setComment: (NSString *)  comment
forKey: (NSString *)  key 

Sets the specified string as a comment for a given configuration key.

Parameters:
comment- string to be replace the existing configuration key comments
key- configuration key for which to be replaced comments
Exceptions:
SCConfigException- configuration file error detected
- (void) setCommentPrefix: (NSString *)  commentPrefix

Sets the specified string as a comments prefix.

Parameters:
commentPrefix- comment prefix
- (void) setComments: (SCStrings *)  comments

Sets the receiving configuration file comments.

Parameters:
comments- list with the comment strings
- (void) setComments: (SCStrings *)  comments
forKey: (NSString *)  key 

Adds the specified text as a comments of a given configuration key.

Parameters:
comments- configuration record comments
key- key for which setting comments
Exceptions:
SCConfigException- configuration file error detected
- (void) setConfigFile: (SCConfigFile *)  configFile

Erases the receiving configuration file and copies all values and settings from the specified existing configuration file.

Parameters:
configFile- existing source configuration file
Exceptions:
SCConfigException- configuration file error detected
- (void) setConfigFileWithPath: (NSString *)  path

Erases the receiving configuration file and copies all values from the file with the specified path.

Parameters:
path- source file path
Exceptions:
SCConfigException- configuration file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) setConfigFileWithStream: (SCStream *)  stream

Erases the receiving configuration file and copies all values from the specified stream.

Parameters:
stream- input stream
Exceptions:
SCConfigException- configuration file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) setConfigFileWithText: (SCStrings *)  text

Erases the receiving configuration file and copies all values from the specified existing strings list.

Parameters:
text- existing source configuration text
Exceptions:
SCConfigException- configuration file error detected
- (void) setLoaded: (BOOL)  loaded [implementation]

Sets the configuration loaded flag.

Parameters:
loaded- YES if the configuration is loaded, otherwise NO
- (void) setPath: (NSString *)  path

Sets the receiving configuration file path.

Parameters:
path- configuration file path
- (void) writeConfigFileToStream: (SCStream *)  stream

Writes the receiving configuration file content into the specified output stream.

Parameters:
stream- destination output stream
Exceptions:
SCConfigException- configuration file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) writeConfigFileToText: (SCStrings *)  text

Writes the receiving configuration file content into the specified strings list.

Parameters:
text- destination strings list
Exceptions:
SCConfigException- configuration file error detected
SCTextException- strings list error detected
- (void) writeConfigFileWithPath: (NSString *)  path

Writes the receiving config file content into the file with the specified path.

Parameters:
path- output file path
Exceptions:
SCConfigException- configuration file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected

The documentation for this class was generated from the following files:
 All Classes Files Functions Typedefs Enumerations Enumerator Defines