Samond Classes Library 1.2.6-STABLE build 219
SCStreamException.h
Go to the documentation of this file.
1 //
2 // SCStreamException.h
3 // scl
4 //
5 // Created by Viacheslav Smolensky on 03.03.12.
6 // Copyright (c) 2007 - 2018 by Samond Development Corporation. All rights reserved.
7 //
8 
22 #import <Foundation/Foundation.h>
23 #import <scl/SCException.h>
24 #import <scl/SCFileStream.h>
25 
26 #pragma mark -
27 #pragma mark Class Constants
28 
37 #define SCStreamExceptionClass @"SCStreamException"
38 
43 #define SCStreamErrorName @"SCStream"
44 
45 
46 #pragma mark -
47 #pragma mark Error ID Constants
48 
57 #define SCStreamEIDUnspecified @"SCL-20020"
58 
63 #define SCStreamEIDNotOpen @"SCL-20021"
64 
69 #define SCStreamEIDReadOnly @"SCL-20022"
70 
75 #define SCStreamEIDWriteOnly @"SCL-20023"
76 
81 #define SCStreamEIDUnknown @"SCL-20024"
82 
87 #define SCStreamEIDUnexpected @"SCL-20025"
88 
93 #define SCStreamEIDUnsupported @"SCL-20026"
94 
99 #define SCStreamEIDIncompleteReading @"SCL-20027"
100 
105 #define SCStreamEIDIncompleteWriting @"SCL-20028"
106 
111 #define SCStreamEIDOpening @"SCL-20029"
112 
117 #define SCStreamEIDRead @"SCL-20030"
118 
123 #define SCStreamEIDWrite @"SCL-20031"
124 
129 #define SCStreamEIDNumber @"SCL-20032"
130 
135 #define SCStreamEIDOpenMode @"SCL-20033"
136 
141 #define SCStreamEIDEmptyPath @"SCL-20034"
142 
147 #define SCStreamEIDEOF @"SCL-20035"
148 
153 #define SCStreamEIDOffset @"SCL-20036"
154 
159 #define SCStreamEIDOffsetWhence @"SCL-20037"
160 
161 
162 #pragma mark -
163 #pragma mark Class Support Types
164 
173 typedef enum {
179 
185 
191 
197 
203 
209 
215 
221 
227 
233 
239 
245 
251 
257 
263 
269 
275 
281 
283 
289 
290 
344  NSString *_streamName; // Erroneous stream name
345  NSString *_unknown; // Unknown class name
346  NSString *_unexpected; // Unexpected class name
347  NSString *_expected; // Expected class name
348  NSString *_unsupported; // Unsupported class name
349  SCSize _readedBytes; // Number of the readed characters
350  SCSize _writedBytes; // Number of the writed characters
351  SCSize _waitedBytes; // Number of the waited characters
352  SCInteger _openError; // Stream open error code
353  SCInteger _readError; // Reading error code
354  SCInteger _writeError; // Writing error code
355  NSString *_numberType; // Unsupported NSNumber type code
356  SCFileStreamOpenMode _openMode; // Incorrect file stream opening mode
357  SCSystemError _seekError; // File stream seeking system error code
358  NSInteger _offset; // Incorrect file stream offset
359  SCFileStreamOffsetWhence _whence; // Incorrect file stream offset whence
360 }
361 
362 #pragma mark -
363 #pragma mark Instance Properties
364 
373 @property (nonatomic, readonly, retain) NSString *streamName;
374 
379 @property (nonatomic, readonly, retain) NSString *unknown;
380 
385 @property (nonatomic, readonly, retain) NSString *unexpected;
386 
391 @property (nonatomic, readonly, retain) NSString *expected;
392 
397 @property (nonatomic, readonly, retain) NSString *unsupported;
398 
403 @property (nonatomic, readonly, assign) SCSize readedBytes;
404 
409 @property (nonatomic, readonly, assign) SCSize writedBytes;
410 
415 @property (nonatomic, readonly, assign) SCSize waitedBytes;
416 
421 @property (nonatomic, readonly, assign) SCInteger openError;
422 
427 @property (nonatomic, readonly, assign) SCInteger readError;
428 
433 @property (nonatomic, readonly, assign) SCInteger writeError;
434 
439 @property (nonatomic, readonly, retain) NSString *numberType;
440 
445 @property (nonatomic, readonly, assign) SCFileStreamOpenMode openMode;
446 
451 @property (nonatomic, readonly, assign) SCSystemError seekError;
452 
457 @property (nonatomic, readonly, assign) NSInteger offset;
458 
463 @property (nonatomic, readonly, assign) SCFileStreamOffsetWhence whence;
464 
467 #pragma mark -
468 #pragma mark Creating and Initializing the Generic Stream Exceptions (SCL-20020)
469 + (instancetype)exceptionWithStream:(NSString *)stream
470  reason:(NSString *)reason
471  code:(SCInteger)code
472  eid:(NSString *)eid;
473 + (instancetype)exceptionWithReason:(NSString *)reason code:(SCInteger)code eid:(NSString *)eid;
474 + (instancetype)exceptionWithStream:(NSString *)stream;
475 + (instancetype)exception;
476 - (instancetype)initWithStream:(NSString *)stream reason:(NSString *)reason code:(SCInteger)code eid:(NSString *)eid;
477 - (instancetype)initWithReason:(NSString *)reason code:(SCInteger)code eid:(NSString *)eid;
478 
479 #pragma mark -
480 #pragma mark Creating Not Open Stream Exception (SCL-20021)
481 + (instancetype)exceptionWithNotOpenStream:(NSString *)stream;
482 + (instancetype)exceptionWithNotOpen;
483 
484 #pragma mark -
485 #pragma mark Creating Read Only Stream Exception (SCL-20022)
486 + (instancetype)exceptionWithReadOnlyStream:(NSString *)stream;
487 + (instancetype)exceptionWithReadOnly;
488 
489 #pragma mark -
490 #pragma mark Creating Write Only Stream Exception (SCL-20023)
491 + (instancetype)exceptionWithWriteOnlyStream:(NSString *)stream;
492 + (instancetype)exceptionWithWriteOnly;
493 
494 #pragma mark -
495 #pragma mark Creating Unknown Class Exception (SCL-20024)
496 + (instancetype)exceptionWithUnknown:(NSString *)name stream:(NSString *)stream;
497 + (instancetype)exceptionWithUnknown:(NSString *)name;
498 
499 #pragma mark -
500 #pragma mark Creating Unexpected Class Exception (SCL-20025)
501 + (instancetype)exceptionWithUnexpected:(NSString *)unexpected expected:(NSString *)expected stream:(NSString *)stream;
502 + (instancetype)exceptionWithUnexpected:(NSString *)unexpected expected:(NSString *)expected;
503 
504 #pragma mark -
505 #pragma mark Creating Unsupported Class Exception (SCL-20026)
506 + (instancetype)exceptionWithUnsupported:(NSString *)name stream:(NSString *)stream;
507 + (instancetype)exceptionWithUnsupported:(NSString *)name;
508 
509 #pragma mark -
510 #pragma mark Creating Incompleted Operation Exception (SCL-20027 and SCL-20028)
511 + (instancetype)exceptionWithReaded:(SCSize)readed waited:(SCSize)waited stream:(NSString *)stream;
512 + (instancetype)exceptionWithReaded:(SCSize)readed waited:(SCSize)waited;
513 + (instancetype)exceptionWithWrited:(SCSize)writed waited:(SCSize)waited stream:(NSString *)stream;
514 + (instancetype)exceptionWithWrited:(SCSize)writed waited:(SCSize)waited;
515 
516 #pragma mark -
517 #pragma mark Creating Opening Exception (SCL-20029)
518 + (instancetype)exceptionWithOpenError:(SCInteger)error stream:(NSString *)stream;
519 + (instancetype)exceptionWithOpenError:(SCInteger)error;
520 
521 #pragma mark -
522 #pragma mark Creating Reading Exception (SCL-20030)
523 + (instancetype)exceptionWithReadError:(SCInteger)error stream:(NSString *)stream;
524 + (instancetype)exceptionWithReadError:(SCInteger)error;
525 
526 #pragma mark -
527 #pragma mark Creating Writing Exception (SCL-20031)
528 + (instancetype)exceptionWithWriteError:(SCInteger)error stream:(NSString *)stream;
529 + (instancetype)exceptionWithWriteError:(SCInteger)error;
530 
531 #pragma mark -
532 #pragma mark Creating Number Object Exception (SCL-20032)
533 + (instancetype)exceptionWithUnsupportedNumberType:(NSString *)type stream:(NSString *)stream;
534 + (instancetype)exceptionWithUnsupportedNumberType:(NSString *)type;
535 
536 #pragma mark -
537 #pragma mark Creating Incorrect Open Mode Exception (SCL-20033)
538 + (instancetype)exceptionWithOpenMode:(SCFileStreamOpenMode)mode path:(NSString *)path;
539 + (instancetype)exceptionWithOpenMode:(SCFileStreamOpenMode)mode;
540 
541 #pragma mark -
542 #pragma mark Creating Empty Path Exception (SCL-20034)
543 + (instancetype)exceptionWithEmptyPath;
544 
545 #pragma mark -
546 #pragma mark Creating End of Stream Exception (SCL-20035)
547 + (instancetype)exceptionWithEndOfFile:(NSString *)file;
548 + (instancetype)exceptionWithEndOfFile;
549 
550 #pragma mark -
551 #pragma mark Creating Offset Exception (SCL-20036 and SCL-20037)
552 + (instancetype)exceptionWithSeekError:(SCSystemError)error
553  whence:(SCFileStreamOffsetWhence)whence
554  offset:(NSInteger)offset
555  path:(NSString *)path;
556 + (instancetype)exceptionWithSeekError:(SCSystemError)error
557  whence:(SCFileStreamOffsetWhence)whence
558  offset:(NSInteger)offset;
559 + (instancetype)exceptionWithSeekError:(SCSystemError)error path:(NSString *)path;
560 + (instancetype)exceptionWithSeekError:(SCSystemError)error;
561 + (instancetype)exceptionWithWhence:(SCFileStreamOffsetWhence)whence path:(NSString *)path;
562 + (instancetype)exceptionWithWhence:(SCFileStreamOffsetWhence)whence;
563 
564 @end
Definition: SCStreamException.h:274
Definition: SCStreamException.h:268
Definition: SCStreamException.h:178
Class SCFileStream header file.
Definition: SCStreamException.h:202
Definition: SCStreamException.h:232
int32_t SCInteger
Definition: SCTypes.h:149
SCStreamErrorCode
Definition: SCStreamException.h:173
Definition: SCStreamException.h:280
Parent class of all library exceptions.
Definition: SCException.h:72
SCFileStreamOpenMode
Definition: SCFileStream.h:97
Definition: SCStreamException.h:214
Definition: SCStreamException.h:190
SCFileStreamOffsetWhence
Definition: SCFileStream.h:172
Definition: SCStreamException.h:262
Definition: SCStreamException.h:226
Definition: SCStreamException.h:256
Definition: SCStreamException.h:184
Definition: SCStreamException.h:220
SCInteger SCSystemError
Definition: SCSystemException.h:83
Definition: SCStreamException.h:244
SCInteger SCStreamError
Definition: SCStreamException.h:288
Definition: SCStreamException.h:238
Exception class SCStreamException.
Definition: SCStreamException.h:343
Exception SCException header file.
Definition: SCStreamException.h:196
Definition: SCStreamException.h:208
size_t SCSize
Definition: SCTypes.h:220
Definition: SCStreamException.h:250