Files
firebase-ios-sdk/FirebaseDatabase/Sources/Utilities/FValidation.h
T

55 lines
2.1 KiB
Objective-C
Raw Normal View History

2017-05-15 12:27:07 -07:00
/*
* Copyright 2017 Google
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
2020-06-22 07:58:52 -07:00
#import "FirebaseDatabase/Sources/Core/Utilities/FPath.h"
2020-07-31 07:22:02 -07:00
#import "FirebaseDatabase/Sources/Public/FirebaseDatabase/FIRDataEventType.h"
2020-06-22 07:58:52 -07:00
#import "FirebaseDatabase/Sources/Utilities/FParsedUrl.h"
#import "FirebaseDatabase/Sources/Utilities/FTypedefs.h"
2019-08-05 13:27:47 -07:00
#import <Foundation/Foundation.h>
2017-05-15 12:27:07 -07:00
@interface FValidation : NSObject
2019-08-05 13:27:47 -07:00
+ (void)validateFrom:(NSString *)fn writablePath:(FPath *)path;
+ (void)validateFrom:(NSString *)fn knownEventType:(FIRDataEventType)event;
+ (void)validateFrom:(NSString *)fn validPathString:(NSString *)pathString;
+ (void)validateFrom:(NSString *)fn validRootPathString:(NSString *)pathString;
+ (void)validateFrom:(NSString *)fn validKey:(NSString *)key;
+ (void)validateFrom:(NSString *)fn validURL:(FParsedUrl *)parsedUrl;
2017-05-15 12:27:07 -07:00
2019-08-05 13:27:47 -07:00
+ (void)validateToken:(NSString *)token;
2017-05-15 12:27:07 -07:00
// Functions for handling passing errors back
2019-08-05 13:27:47 -07:00
+ (void)handleError:(NSError *)error
withUserCallback:(fbt_void_nserror_id)userCallback;
+ (void)handleError:(NSError *)error
withSuccessCallback:(fbt_void_nserror)userCallback;
2017-05-15 12:27:07 -07:00
// Functions used for validating while creating snapshots in FSnapshotUtilities
2019-08-05 13:27:47 -07:00
+ (BOOL)validateFrom:(NSString *)fn
isValidLeafValue:(id)value
withPath:(NSArray *)path;
+ (void)validateFrom:(NSString *)fn
validDictionaryKey:(id)keyId
withPath:(NSArray *)path;
+ (void)validateFrom:(NSString *)fn
validUpdateDictionaryKey:(id)keyId
withValue:(id)value;
+ (void)validateFrom:(NSString *)fn
isValidPriorityValue:(id)value
withPath:(NSArray *)path;
+ (BOOL)validatePriorityValue:value;
2017-05-15 12:27:07 -07:00
@end