1 |
efrain |
1 |
// Copyright 2020 Google LLC
|
|
|
2 |
//
|
|
|
3 |
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
4 |
// you may not use this file except in compliance with the License.
|
|
|
5 |
// You may obtain a copy of the License at
|
|
|
6 |
//
|
|
|
7 |
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
8 |
//
|
|
|
9 |
// Unless required by applicable law or agreed to in writing, software
|
|
|
10 |
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
12 |
// See the License for the specific language governing permissions and
|
|
|
13 |
// limitations under the License.
|
|
|
14 |
|
|
|
15 |
#import <Foundation/Foundation.h>
|
|
|
16 |
|
|
|
17 |
/** Trims the given name string and checks if the name is reservable.
|
|
|
18 |
*
|
|
|
19 |
* @param name The name to be checked for reservability.
|
|
|
20 |
* @return Reservable name or nil if there is an error.
|
|
|
21 |
*/
|
|
|
22 |
FOUNDATION_EXTERN NSString *FPRReservableName(NSString *name);
|
|
|
23 |
|
|
|
24 |
/** Trims the given name string and checks if the name is reservable.
|
|
|
25 |
*
|
|
|
26 |
* @param name The name to be checked for reservability for an attribute name.
|
|
|
27 |
* @return Reservable name or nil if there is an error.
|
|
|
28 |
*/
|
|
|
29 |
FOUNDATION_EXTERN NSString *FPRReservableAttributeName(NSString *name);
|
|
|
30 |
|
|
|
31 |
/** Checks if the given attribute value follows length restrictions.
|
|
|
32 |
*
|
|
|
33 |
* @param value The value to be checked.
|
|
|
34 |
* @return Valid value or nil if that does not adhere to length restrictions.
|
|
|
35 |
*/
|
|
|
36 |
FOUNDATION_EXTERN NSString *FPRValidatedAttributeValue(NSString *value);
|
|
|
37 |
|
|
|
38 |
/** Truncates the URL string if the length of the URL going beyond the defined limit. The truncation
|
|
|
39 |
* will happen upto the end of a complete query sub path whose length is less than limit.
|
|
|
40 |
* For example: If the URL is abc.com/one/two/three/four and if the URL max length is 20, trimmed
|
|
|
41 |
* URL will be to abc.com/one/two and not abc.com/one/two/thre (three is incomplete).
|
|
|
42 |
* If the domain name goes beyond 2000 characters (which is unlikely), that might result in an
|
|
|
43 |
* empty string being returned.
|
|
|
44 |
*
|
|
|
45 |
* @param URLString A URL string.
|
|
|
46 |
* @return The unchanged url string or a truncated version if the length goes beyond the limit.
|
|
|
47 |
*/
|
|
|
48 |
FOUNDATION_EXTERN NSString *FPRTruncatedURLString(NSString *URLString);
|
|
|
49 |
|
|
|
50 |
/** Ensures proper length and numerals and returns a concatenated version if valid.
|
|
|
51 |
*
|
|
|
52 |
* @param mcc 3 digit MCC code.
|
|
|
53 |
* @param mnc 2 or 3 digit MNC code.
|
|
|
54 |
* @return Concatenated mcc and mnc codes if valid. Otherwise nil.
|
|
|
55 |
*/
|
|
|
56 |
FOUNDATION_EXTERN NSString *FPRValidatedMccMnc(NSString *mcc, NSString *mnc);
|