Skip to content

Commit e33308b

Browse files
committed
Fix indentation
1 parent e78dc57 commit e33308b

File tree

3 files changed

+75
-75
lines changed

3 files changed

+75
-75
lines changed

Classes/GlobalStateExplorers/DatabaseBrowser/FLEXSQLiteDatabaseManager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
#import "FLEXDatabaseManager.h"
1616

1717
@interface FLEXSQLiteDatabaseManager : NSObject <FLEXDatabaseManager>
18-
- (NSString *)executeNonSelectQuery:(NSString *)sql;
19-
- (NSArray<NSDictionary<NSString *, id> *> *)executeSelectionQuery:(NSString *)sql and: (NSString **)error;
18+
- (NSString *)executeNonSelectQuery:(NSString *)sql;
19+
- (NSArray<NSDictionary<NSString *, id> *> *)executeSelectionQuery:(NSString *)sql error:(NSString **)error;
2020
@end

Classes/GlobalStateExplorers/DatabaseBrowser/FLEXSQLiteDatabaseManager.m

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@
1414
static NSString *const QUERY_TABLENAMES_SQL = @"SELECT name FROM sqlite_master WHERE type='table' ORDER BY name";
1515

1616
@implementation FLEXSQLiteDatabaseManager
17-
{
18-
sqlite3* _db;
19-
NSString* _databasePath;
20-
}
21-
17+
{
18+
sqlite3* _db;
19+
NSString* _databasePath;
20+
}
21+
2222
- (instancetype)initWithPath:(NSString*)aPath
23-
{
24-
self = [super init];
25-
26-
if (self) {
27-
_databasePath = [aPath copy];
28-
}
29-
return self;
23+
{
24+
self = [super init];
25+
if (self) {
26+
_databasePath = [aPath copy];
3027
}
3128

29+
return self;
30+
}
31+
3232
- (BOOL)open {
3333
if (_db) {
3434
return YES;
@@ -51,7 +51,7 @@ - (BOOL)open {
5151
}
5252
return YES;
5353
}
54-
54+
5555
- (BOOL)close {
5656
if (!_db) {
5757
return YES;
@@ -84,12 +84,12 @@ - (BOOL)close {
8484
_db = nil;
8585
return YES;
8686
}
87-
88-
87+
88+
8989
- (NSArray<NSDictionary<NSString *, id> *> *)queryAllTables {
9090
return [self executeQuery:QUERY_TABLENAMES_SQL];
9191
}
92-
92+
9393
- (NSArray<NSString *> *)queryAllColumnsWithTableName:(NSString *)tableName {
9494
NSString *sql = [NSString stringWithFormat:@"PRAGMA table_info('%@')",tableName];
9595
NSArray<NSDictionary<NSString *, id> *> *resultArray = [self executeQuery:sql];
@@ -100,12 +100,12 @@ - (BOOL)close {
100100
}
101101
return array;
102102
}
103-
103+
104104
- (NSArray<NSDictionary<NSString *, id> *> *)queryAllDataWithTableName:(NSString *)tableName {
105105
NSString *sql = [NSString stringWithFormat:@"SELECT * FROM %@",tableName];
106106
return [self executeQuery:sql];
107107
}
108-
108+
109109
- (NSString *)executeNonSelectQuery:(NSString *)sql {
110110
NSString *error = nil;
111111

@@ -115,18 +115,18 @@ - (NSString *)executeNonSelectQuery:(NSString *)sql {
115115
if (sqlite3_prepare_v2(_db, [sql UTF8String], -1, &pstmt, NULL) != SQLITE_OK) {
116116
return [NSString stringWithFormat: @"Prepare failure: %s", sqlite3_errmsg(_db)];
117117
}
118-
118+
119119
if (sqlite3_step(pstmt) != SQLITE_DONE) {
120120
return [NSString stringWithFormat: @"Step failure: %s", sqlite3_errmsg(_db)];
121121
}
122-
122+
123123
sqlite3_finalize(pstmt);
124-
124+
125125
[self close];
126-
126+
127127
return error;
128128
}
129-
129+
130130
- (NSArray<NSDictionary<NSString *, id> *> *)executeSelectionQuery: (NSString *)sql and: (NSString **)error {
131131
[self open];
132132

@@ -165,11 +165,11 @@ - (NSString *)executeNonSelectQuery:(NSString *)sql {
165165

166166
return resultArray;
167167
}
168-
169-
168+
169+
170170
#pragma mark -
171171
#pragma mark - Private
172-
172+
173173
- (NSArray<NSDictionary<NSString *, id> *> *)executeQuery:(NSString *)sql {
174174
[self open];
175175
NSMutableArray<NSDictionary<NSString *, id> *> *resultArray = [NSMutableArray array];
@@ -198,10 +198,10 @@ - (NSString *)executeNonSelectQuery:(NSString *)sql {
198198

199199
return resultArray;
200200
}
201-
201+
202202
- (id)objectForColumnIndex:(int)columnIdx stmt:(sqlite3_stmt*)stmt {
203203
int columnType = sqlite3_column_type(stmt, columnIdx);
204-
204+
205205
id returnValue = nil;
206206

207207
if (columnType == SQLITE_INTEGER) {
@@ -224,7 +224,7 @@ - (id)objectForColumnIndex:(int)columnIdx stmt:(sqlite3_stmt*)stmt {
224224

225225
return returnValue;
226226
}
227-
227+
228228
- (NSString *)stringForColumnIndex:(int)columnIdx stmt:(sqlite3_stmt *)stmt {
229229

230230
if (sqlite3_column_type(stmt, columnIdx) == SQLITE_NULL || (columnIdx < 0)) {
@@ -240,21 +240,21 @@ - (NSString *)stringForColumnIndex:(int)columnIdx stmt:(sqlite3_stmt *)stmt {
240240

241241
return [NSString stringWithUTF8String:c];
242242
}
243-
244-
- (NSData *)dataForColumnIndex:(int)columnIdx stmt:(sqlite3_stmt *)stmt {
245-
246-
if (sqlite3_column_type(stmt, columnIdx) == SQLITE_NULL || (columnIdx < 0)) {
247-
return nil;
248-
}
249-
250-
const char *dataBuffer = sqlite3_column_blob(stmt, columnIdx);
251-
int dataSize = sqlite3_column_bytes(stmt, columnIdx);
252-
253-
if (dataBuffer == NULL) {
254-
return nil;
255-
}
256-
257-
return [NSData dataWithBytes:(const void *)dataBuffer length:(NSUInteger)dataSize];
258-
}
259-
243+
244+
- (NSData *)dataForColumnIndex:(int)columnIdx stmt:(sqlite3_stmt *)stmt {
245+
246+
if (sqlite3_column_type(stmt, columnIdx) == SQLITE_NULL || (columnIdx < 0)) {
247+
return nil;
248+
}
249+
250+
const char *dataBuffer = sqlite3_column_blob(stmt, columnIdx);
251+
int dataSize = sqlite3_column_bytes(stmt, columnIdx);
252+
253+
if (dataBuffer == NULL) {
254+
return nil;
255+
}
256+
257+
return [NSData dataWithBytes:(const void *)dataBuffer length:(NSUInteger)dataSize];
258+
}
259+
260260
@end

Classes/GlobalStateExplorers/SQLExecutionControllers/FLEXSQLCommandExecutionViewController.m

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
#import <objc/runtime.h>
1616

1717
@interface FLEXSQLCommandExecutionViewController ()
18-
@property (nonatomic) UITextView* textView;
19-
@property (nonatomic) UIButton* submitButton;
20-
@property (nonatomic) UILabel* statusLabel;
21-
@end
18+
@property (nonatomic) UITextView* textView;
19+
@property (nonatomic) UIButton* submitButton;
20+
@property (nonatomic) UILabel* statusLabel;
21+
@end
2222

2323
@implementation FLEXSQLCommandExecutionViewController
24-
@synthesize isSelectionType, dbManager, textView, submitButton, statusLabel;
25-
24+
@synthesize isSelectionType, dbManager, textView, submitButton, statusLabel;
25+
2626
- (void)viewDidLoad {
2727
[super viewDidLoad];
2828

@@ -31,11 +31,11 @@ - (void)viewDidLoad {
3131

3232
[self addOtherUIElementsAndPositionThem];
3333
}
34-
34+
3535
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
3636
[self addOtherUIElementsAndPositionThem];
3737
}
38-
38+
3939
- (void)addOtherUIElementsAndPositionThem {
4040
if(textView == nil) {
4141
textView = [UITextView new];
@@ -78,7 +78,7 @@ - (void)addOtherUIElementsAndPositionThem {
7878
statusLabel.frame = CGRectMake(sideMargin, textView.frame.origin.y + textViewHeight + sideMargin, width, statusLabelHeight);
7979
submitButton.frame = CGRectMake(sideMargin, statusLabel.frame.origin.y + statusLabelHeight + sideMargin, width, submitButtonHeight);
8080
}
81-
81+
8282
- (void)submitPressed {
8383
NSString* text = textView.text == nil ? @"" : textView.text;
8484

@@ -115,22 +115,22 @@ - (void)submitPressed {
115115
statusLabel.text = errorMessage == nil ? @"SUCCESS" : errorMessage;
116116
}
117117
}
118-
119-
118+
119+
120120
- (void)presentOnErrorAlert: (NSString *)message
121-
{
122-
UIAlertController * alert = [UIAlertController
123-
alertControllerWithTitle:@"SQL Execution error !!!"
124-
message: message
125-
preferredStyle:UIAlertControllerStyleAlert];
126-
127-
UIAlertAction* okButton = [UIAlertAction
128-
actionWithTitle:@"Ok"
129-
style:UIAlertActionStyleDestructive
130-
handler: nil];
131-
132-
[alert addAction:okButton];
133-
[self presentViewController:alert animated:YES completion:nil];
134-
}
135-
136-
@end
121+
{
122+
UIAlertController * alert = [UIAlertController
123+
alertControllerWithTitle:@"SQL Execution error !!!"
124+
message: message
125+
preferredStyle:UIAlertControllerStyleAlert];
126+
127+
UIAlertAction* okButton = [UIAlertAction
128+
actionWithTitle:@"Ok"
129+
style:UIAlertActionStyleDestructive
130+
handler: nil];
131+
132+
[alert addAction:okButton];
133+
[self presentViewController:alert animated:YES completion:nil];
134+
}
135+
136+
@end

0 commit comments

Comments
 (0)