-
Notifications
You must be signed in to change notification settings - Fork 0
/
Util.h
61 lines (47 loc) · 1.53 KB
/
Util.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// Util.h
// RasterPathCodingTask
//
// Created by Peter Megyesi on 2015. 06. 26..
// Copyright (c) 2015. petya. All rights reserved.
//
#import <Foundation/Foundation.h>
FOUNDATION_EXPORT NSString *const DIMENSION_STR;
FOUNDATION_EXPORT NSString *const WIDTH_STR;
FOUNDATION_EXPORT NSString *const START_X_STR;
FOUNDATION_EXPORT NSString *const START_Y_STR;
FOUNDATION_EXPORT NSString *const END_X_STR;
FOUNDATION_EXPORT NSString *const END_Y_STR;
FOUNDATION_EXPORT NSString *const WEIGHT_OPTION_STR;
FOUNDATION_EXPORT NSString *const PATH_STR;
typedef NS_ENUM(NSInteger, Octant_t) {
octant_1 = 1,
octant_2,
octant_3,
octant_4,
octant_5,
octant_6,
octant_7,
octant_8
};
/*!
@class Util
@brief Utility class mainly handling I/O and serving some consts and typdefs
@helps RPPoint, main
*/
@interface Util : NSObject
/*
@brief Handles initial user input on the console.
@discussion Data input either manually (terminal) or from file.
(File location is prompted in terminal.)
@return A Dictionary of all the data necessary for the calculations (parsed from file or terminal).
*/
+ (NSDictionary *)runMainMenuInTerminal;
+ (int)getNumberFromUserWithFileHandle:(NSFileHandle*)fileHandle withMin:(int)minNumber;
+ (int)getNumberFromUserWithFileHandle:(NSFileHandle *)fileHandle withMin:(int)minNumber withMax:(int)maxNumber;
/*!
@brief Asks (console) for output path and if weight option should be printed.
@return Path and weightOption in a Dictionary
*/
+ (NSDictionary *)displayFarewellMsg;
@end