aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objc/utils/MCORange.h
blob: 1f2f971588ea606ac9bd5b6c0b7acb7c6274326c (plain)
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
//
//  MCORange.h
//  mailcore2
//
//  Created by DINH Viêt Hoà on 3/24/13.
//  Copyright (c) 2013 MailCore. All rights reserved.
//

#ifndef mailcore2_MCORange_h
#define mailcore2_MCORange_h

#import <Foundation/Foundation.h>

#ifdef __cplusplus
#include <mailcore/MCBaseTypes.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

@class MCOIndexSet;

typedef struct {
    uint64_t location;
    uint64_t length;
} MCORange;

extern MCORange RangeEmpty;

MCORange MCORangeMake(uint64_t location, uint64_t length);
MCOIndexSet * MCORangeRemoveRange(MCORange range1, MCORange range2);
MCOIndexSet * MCORangeUnion(MCORange range1, MCORange range2);
#ifdef __cplusplus
mailcore::Range MCORangeToMCRange(MCORange range);
MCORange MCORangeWithMCRange(mailcore::Range range);
#endif
MCORange MCORangeIntersection(MCORange range1, MCORange range2);
BOOL MCORangeHasIntersection(MCORange range1, MCORange range2);
uint64_t MCORangeLeftBound(MCORange range);
uint64_t MCORangeRightBound(MCORange range);

#ifdef __cplusplus
}
#endif

#endif