Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
GMPhobos
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
GMPhobos
Commits
3d514a17
Commit
3d514a17
authored
May 13, 2016
by
汪洋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save
parent
fedb23e9
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
380 additions
and
0 deletions
+380
-0
WMCacheService.h
Example/Pods/GMCache/GMCache/Classes/WMCacheService.h
+113
-0
WMCacheService.m
Example/Pods/GMCache/GMCache/Classes/WMCacheService.m
+119
-0
WMDocumentCache.h
Example/Pods/GMCache/GMCache/Classes/WMDocumentCache.h
+13
-0
WMDocumentCache.m
Example/Pods/GMCache/GMCache/Classes/WMDocumentCache.m
+30
-0
LICENSE
Example/Pods/GMCache/LICENSE
+19
-0
README.md
Example/Pods/GMCache/README.md
+29
-0
GMCache-dummy.m
Example/Pods/Target Support Files/GMCache/GMCache-dummy.m
+5
-0
GMCache-prefix.pch
Example/Pods/Target Support Files/GMCache/GMCache-prefix.pch
+4
-0
GMCache-umbrella.h
Example/Pods/Target Support Files/GMCache/GMCache-umbrella.h
+7
-0
GMCache.modulemap
Example/Pods/Target Support Files/GMCache/GMCache.modulemap
+6
-0
GMCache.xcconfig
Example/Pods/Target Support Files/GMCache/GMCache.xcconfig
+9
-0
Info.plist
Example/Pods/Target Support Files/GMCache/Info.plist
+26
-0
No files found.
Example/Pods/GMCache/GMCache/Classes/WMCacheService.h
0 → 100644
View file @
3d514a17
//
// CacheService.h
// Gengmei
//
// Created by Thierry on 1/5/15.
// Copyright (c) 2015 Wanmeichuangyi. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <TMCache/TMCache.h>
typedef
NS_ENUM
(
NSUInteger
,
WMCacheMethod
)
{
WMCacheDiskMethod
=
1
,
WMCacheMemoryMethod
};
@interface
WMCacheService
:
NSObject
@property
(
nonatomic
,
strong
)
NSString
*
urlCommonString
;
+
(
instancetype
)
sharedInstance
;
/**
* @brief 异步磁盘读写操作
*/
/*** @brief 由对应的键获取对应的缓存数据*/
-
(
void
)
storeObjectAtDiskWithkey
:(
NSString
*
)
key
object
:(
id
<
NSCoding
>
)
object
block
:(
TMDiskCacheObjectBlock
)
block
;
/*** @brief 给特定的键,标记缓存数据并缓存*/
-
(
void
)
fetchObjectAtDiskWithkey
:(
NSString
*
)
key
block
:(
TMDiskCacheObjectBlock
)
block
;
/*** @brief 删除特定的键,对应的缓存数据*/
-
(
void
)
removeObjectAtDiskWithkey
:(
NSString
*
)
key
block
:(
TMDiskCacheObjectBlock
)
block
;
/*** @brief 清空所有的缓存数据*/
-
(
void
)
removeAllObjectsAtDiskWithBlock
:(
TMDiskCacheBlock
)
block
;
/**
* @brief 同步磁盘读写操作
*/
/*** @brief 由对应的键获取对应的缓存数据*/
-
(
void
)
storeObjectAtDiskWithkey
:(
NSString
*
)
key
object
:(
id
<
NSCoding
>
)
object
;
/*** @brief 给特定的键,标记缓存数据并缓存*/
-
(
id
)
fetchObjectAtDiskWithkey
:(
NSString
*
)
key
;
/*** @brief 删除特定的键,对应的缓存数据*/
-
(
void
)
removeObjectAtDiskWithkey
:(
NSString
*
)
key
;
/*** @brief 清空所有的缓存数据*/
-
(
void
)
removeAllObjectsAtDisk
;
/**
* @brief 异步内存读写操作
*/
/*** @brief 由对应的键获取对应的缓存数据*/
-
(
void
)
storeObjectAtMemoryWithkey
:(
NSString
*
)
key
object
:(
id
<
NSCoding
>
)
object
block
:(
TMMemoryCacheObjectBlock
)
block
;
/*** @brief 给特定的键,标记缓存数据并缓存*/
-
(
void
)
fetchObjectAtMemoryWithkey
:(
NSString
*
)
key
block
:(
TMMemoryCacheObjectBlock
)
block
;
/*** @brief 删除特定的键,对应的缓存数据*/
-
(
void
)
removeObjectAtMemoryWithkey
:(
NSString
*
)
key
block
:(
TMMemoryCacheObjectBlock
)
block
;
/*** @brief 清空所有的缓存数据*/
-
(
void
)
removeAllObjectsAtMemoryWithBlock
:(
TMMemoryCacheBlock
)
block
;
/**
* @brief 同步内存读写操作
*/
/*** @brief 由对应的键获取对应的缓存数据*/
-
(
void
)
storeObjectAtMemoryWithkey
:(
NSString
*
)
key
object
:(
id
)
object
;
/*** @brief 给特定的键,标记缓存数据并缓存*/
-
(
id
)
fetchObjectAtMemoryWithkey
:(
NSString
*
)
key
;
/*** @brief 删除特定的键,对应的缓存数据*/
-
(
void
)
removeObjectAtMemoryWithkey
:(
NSString
*
)
key
;
/*** @brief 清空所有的缓存数据*/
-
(
void
)
removeAllObjectsAtMemory
;
#pragma mark - 这里将数据缓存到Ducument目录下
/**
* @brief 异步磁盘读写操作
*/
-
(
void
)
storeObjectAtDucmentPathWithkey
:(
NSString
*
)
key
object
:(
id
<
NSCoding
>
)
object
block
:(
TMDiskCacheObjectBlock
)
block
;
-
(
void
)
fetchObjectAtDucmentPathWithkey
:(
NSString
*
)
key
block
:(
TMDiskCacheObjectBlock
)
block
;
-
(
void
)
removeObjectAtDucmentPathWithkey
:(
NSString
*
)
key
block
:(
TMDiskCacheObjectBlock
)
block
;
-
(
void
)
removeAllObjectsAtDucmentPathWithBlock
:(
TMDiskCacheBlock
)
block
;
/**
* @brief 同步内存读写操作
*/
-
(
void
)
storeObjectAtDucmentPathWithkey
:(
NSString
*
)
key
object
:(
id
<
NSCoding
>
)
object
;
-
(
id
)
fetchObjectAtDucmentPathWithkey
:(
NSString
*
)
key
;
-
(
void
)
removeObjectAtDucmentPathWithkey
:(
NSString
*
)
key
;
-
(
void
)
removeAllObjectsAtDucmentPath
;
@end
Example/Pods/GMCache/GMCache/Classes/WMCacheService.m
0 → 100644
View file @
3d514a17
//
// CacheService.m
// Gengmei
//
// Created by Thierry on 1/5/15.
// Copyright (c) 2015 Wanmeichuangyi. All rights reserved.
//
#import "WMCacheService.h"
#import "WMDocumentCache.h"
static
WMCacheService
*
sharedManager
=
nil
;
@implementation
WMCacheService
+
(
instancetype
)
sharedInstance
{
static
dispatch_once_t
oncePredicate
;
dispatch_once
(
&
oncePredicate
,
^
{
sharedManager
=
[[
WMCacheService
alloc
]
init
];
});
return
sharedManager
;
}
-
(
void
)
storeObjectAtDiskWithkey
:
(
NSString
*
)
key
object
:
(
id
<
NSCoding
>
)
object
block
:
(
TMDiskCacheObjectBlock
)
block
{
[[
TMCache
sharedCache
].
diskCache
setObject
:
object
forKey
:
key
block
:
block
];
}
-
(
void
)
fetchObjectAtDiskWithkey
:
(
NSString
*
)
key
block
:
(
TMDiskCacheObjectBlock
)
block
{
[[
TMCache
sharedCache
].
diskCache
objectForKey
:
key
block
:
block
];
}
-
(
void
)
removeObjectAtDiskWithkey
:
(
NSString
*
)
key
block
:
(
TMDiskCacheObjectBlock
)
block
{
[[
TMCache
sharedCache
].
diskCache
removeObjectForKey
:
key
block
:
block
];
}
-
(
void
)
removeAllObjectsAtDiskWithBlock
:
(
TMDiskCacheBlock
)
block
{
[[
TMCache
sharedCache
].
diskCache
removeAllObjects
:
block
];
}
-
(
void
)
storeObjectAtDiskWithkey
:
(
NSString
*
)
key
object
:
(
id
<
NSCoding
>
)
object
{
[[
TMCache
sharedCache
].
diskCache
setObject
:
object
forKey
:
key
];
}
-
(
id
)
fetchObjectAtDiskWithkey
:
(
NSString
*
)
key
{
return
[[
TMCache
sharedCache
].
diskCache
objectForKey
:
key
];
}
-
(
void
)
removeObjectAtDiskWithkey
:
(
NSString
*
)
key
{
[[
TMCache
sharedCache
].
diskCache
removeObjectForKey
:
key
];
}
-
(
void
)
removeAllObjectsAtDisk
{
[[
TMCache
sharedCache
].
diskCache
removeAllObjects
];
}
-
(
void
)
storeObjectAtMemoryWithkey
:
(
NSString
*
)
key
object
:
(
id
<
NSCoding
>
)
object
block
:
(
TMMemoryCacheObjectBlock
)
block
{
[[
TMCache
sharedCache
].
memoryCache
setObject
:
object
forKey
:
key
block
:
block
];
}
-
(
void
)
fetchObjectAtMemoryWithkey
:
(
NSString
*
)
key
block
:
(
TMMemoryCacheObjectBlock
)
block
{
[[
TMCache
sharedCache
].
memoryCache
objectForKey
:
key
block
:
block
];
}
-
(
void
)
removeObjectAtMemoryWithkey
:
(
NSString
*
)
key
block
:
(
TMMemoryCacheObjectBlock
)
block
{
[[
TMCache
sharedCache
].
memoryCache
removeObjectForKey
:
key
block
:
block
];
}
-
(
void
)
removeAllObjectsAtMemoryWithBlock
:
(
TMMemoryCacheBlock
)
block
{
[[
TMCache
sharedCache
].
memoryCache
removeAllObjects
:
block
];
}
-
(
void
)
storeObjectAtMemoryWithkey
:
(
NSString
*
)
key
object
:
(
id
)
object
{
[[
TMCache
sharedCache
].
memoryCache
setObject
:
object
forKey
:
key
];
}
-
(
id
)
fetchObjectAtMemoryWithkey
:
(
NSString
*
)
key
{
return
[[
TMCache
sharedCache
].
memoryCache
objectForKey
:
key
];
}
-
(
void
)
removeObjectAtMemoryWithkey
:
(
NSString
*
)
key
{
[[
TMCache
sharedCache
].
memoryCache
removeObjectForKey
:
key
];
}
-
(
void
)
removeAllObjectsAtMemory
{
[[
TMCache
sharedCache
].
memoryCache
removeAllObjects
];
}
-
(
void
)
storeObjectAtDucmentPathWithkey
:
(
NSString
*
)
key
object
:
(
id
<
NSCoding
>
)
object
block
:
(
TMDiskCacheObjectBlock
)
block
{
[[
WMDocumentCache
sharedCache
].
diskCache
setObject
:
object
forKey
:
key
block
:
block
];
}
-
(
void
)
fetchObjectAtDucmentPathWithkey
:
(
NSString
*
)
key
block
:
(
TMDiskCacheObjectBlock
)
block
{
[[
WMDocumentCache
sharedCache
].
diskCache
objectForKey
:
key
block
:
block
];
}
-
(
void
)
removeObjectAtDucmentPathWithkey
:
(
NSString
*
)
key
block
:
(
TMDiskCacheObjectBlock
)
block
{
[[
WMDocumentCache
sharedCache
].
diskCache
removeObjectForKey
:
key
block
:
block
];
}
-
(
void
)
removeAllObjectsAtDucmentPathWithBlock
:
(
TMDiskCacheBlock
)
block
{
[[
WMDocumentCache
sharedCache
].
diskCache
removeAllObjects
:
block
];
}
-
(
void
)
storeObjectAtDucmentPathWithkey
:
(
NSString
*
)
key
object
:
(
id
<
NSCoding
>
)
object
{
[[
WMDocumentCache
sharedCache
].
diskCache
setObject
:
object
forKey
:
key
];
}
-
(
id
)
fetchObjectAtDucmentPathWithkey
:
(
NSString
*
)
key
{
return
[[
WMDocumentCache
sharedCache
].
diskCache
objectForKey
:
key
];
}
-
(
void
)
removeObjectAtDucmentPathWithkey
:
(
NSString
*
)
key
{
[[
WMDocumentCache
sharedCache
].
diskCache
removeObjectForKey
:
key
];
}
-
(
void
)
removeAllObjectsAtDucmentPath
{
[[
WMDocumentCache
sharedCache
].
diskCache
removeAllObjects
];
}
@end
Example/Pods/GMCache/GMCache/Classes/WMDocumentCache.h
0 → 100644
View file @
3d514a17
//
// WMCache.h
// Gengmei
//
// Created by Sean Lee on 7/23/15.
// Copyright (c) 2015 Wanmeichuangyi. All rights reserved.
//
#import <TMCache/TMCache.h>
@interface
WMDocumentCache
:
TMCache
@end
Example/Pods/GMCache/GMCache/Classes/WMDocumentCache.m
0 → 100644
View file @
3d514a17
//
// WMCache.m
// Gengmei
//
// Created by Sean Lee on 7/23/15.
// Copyright (c) 2015 Wanmeichuangyi. All rights reserved.
//
#import "WMDocumentCache.h"
NSString
*
const
WMCacheSharedName
=
@"WMCacheShared"
;
@implementation
WMDocumentCache
+
(
instancetype
)
sharedCache
{
static
id
cache
;
static
dispatch_once_t
predicate
;
dispatch_once
(
&
predicate
,
^
{
cache
=
[[
self
alloc
]
initWithName
:
WMCacheSharedName
rootPath
:[
NSSearchPathForDirectoriesInDomains
(
NSDocumentDirectory
,
NSUserDomainMask
,
YES
)
objectAtIndex
:
0
]];
});
return
cache
;
}
@end
Example/Pods/GMCache/LICENSE
0 → 100644
View file @
3d514a17
Copyright (c) 2016 wangyang <wangyang@wanmeizhensuo.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Example/Pods/GMCache/README.md
0 → 100644
View file @
3d514a17
# GMCache
[

](https://travis-ci.org/wangyang/GMCache)
[

](http://cocoapods.org/pods/GMCache)
[

](http://cocoapods.org/pods/GMCache)
[

](http://cocoapods.org/pods/GMCache)
## Usage
To run the example project, clone the repo, and run
`pod install`
from the Example directory first.
## Requirements
## Installation
GMCache is available through
[
CocoaPods
](
http://cocoapods.org
)
. To install
it, simply add the following line to your Podfile:
```
ruby
pod
"GMCache"
```
## Author
wangyang, wangyang@wanmeizhensuo.com
## License
GMCache is available under the MIT license. See the LICENSE file for more info.
Example/Pods/Target Support Files/GMCache/GMCache-dummy.m
0 → 100644
View file @
3d514a17
#import <Foundation/Foundation.h>
@interface
PodsDummy_GMCache
:
NSObject
@end
@implementation
PodsDummy_GMCache
@end
Example/Pods/Target Support Files/GMCache/GMCache-prefix.pch
0 → 100644
View file @
3d514a17
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif
Example/Pods/Target Support Files/GMCache/GMCache-umbrella.h
0 → 100644
View file @
3d514a17
#import <UIKit/UIKit.h>
#import "WMCacheService.h"
FOUNDATION_EXPORT
double
GMCacheVersionNumber
;
FOUNDATION_EXPORT
const
unsigned
char
GMCacheVersionString
[];
Example/Pods/Target Support Files/GMCache/GMCache.modulemap
0 → 100644
View file @
3d514a17
framework module GMCache {
umbrella header "GMCache-umbrella.h"
export *
module * { export * }
}
Example/Pods/Target Support Files/GMCache/GMCache.xcconfig
0 → 100644
View file @
3d514a17
CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/GMCache
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/TMCache"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES
Example/Pods/Target Support Files/GMCache/Info.plist
0 → 100644
View file @
3d514a17
<
?xml
v
e
rsion="
1
.
0
"
e
n
c
o
d
ing="UT
F
-
8
"?
>
<
!
D
O
C
TYP
E
plist
PU
B
LI
C
"-//
A
ppl
e
//
D
T
D
PLIST
1
.
0
//
E
N"
"http://www.
a
ppl
e
.
c
om/
D
T
D
s/Prop
e
rtyList-
1
.
0
.
d
t
d
"
>
<
plist
v
e
rsion="
1
.
0
"
>
<
d
i
c
t
>
<
k
e
y
>
CFBundleDevelopmentRegion
<
/k
e
y
>
<
string
>
en
<
/string
>
<
k
e
y
>
CFBundleExecutable
<
/k
e
y
>
<
string
>
$
{
EXECUTABLE_NAME
}<
/string
>
<
k
e
y
>
CFBundleIdentifier
<
/k
e
y
>
<
string
>
$
{
PRODUCT_BUNDLE_IDENTIFIER
}<
/string
>
<
k
e
y
>
CFBundleInfoDictionaryVersion
<
/k
e
y
>
<
string
>
6.0
<
/string
>
<
k
e
y
>
CFBundleName
<
/k
e
y
>
<
string
>
$
{
PRODUCT_NAME
}<
/string
>
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
FMWK
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
0.1.0
<
/string
>
<
k
e
y
>
CFBundleSignature
<
/k
e
y
>
<
string
>
????
<
/string
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
$
{
CURRENT_PROJECT_VERSION
}<
/string
>
<
k
e
y
>
NSPrincipalClass
<
/k
e
y
>
<
string
><
/string
>
<
/
d
i
c
t
>
<
/plist
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment