-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of http://git.sukimashita.com/libplist into chr…
…onic Conflicts: .gitignore
- Loading branch information
Showing
12 changed files
with
918 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ libcnary/*.o | |
src/*.o | ||
libplist.a | ||
libplist++.a | ||
|
||
*.swp | ||
build/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FIND_PROGRAM(CYTHON_EXECUTABLE cython) | ||
|
||
INCLUDE(FindPackageHandleStandardArgs) | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cython DEFAULT_MSG CYTHON_EXECUTABLE) | ||
|
||
MARK_AS_ADVANCED(CYTHON_EXECUTABLE) | ||
|
||
IF(CYTHON_FOUND) | ||
SET(CYTHON_USE_FILE ${CMAKE_SOURCE_DIR}/cmake/modules/UseCython.cmake) | ||
ENDIF(CYTHON_FOUND) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_PATH} ${CMAKE_CURRENT_SOURCE_DIR} ) | ||
|
||
|
||
SET(plist_SRC | ||
${CMAKE_CURRENT_BINARY_DIR}/plist.c ) | ||
|
||
SET(plist_HDR | ||
${CMAKE_CURRENT_SOURCE_DIR}/plist.pxd ) | ||
|
||
ADD_CUSTOM_COMMAND( | ||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/plist.c | ||
COMMAND ${CYTHON_EXECUTABLE} -o ${CMAKE_CURRENT_BINARY_DIR}/plist.c ${CMAKE_CURRENT_SOURCE_DIR}/plist.pyx | ||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/plist.pyx ${CMAKE_CURRENT_SOURCE_DIR}/plist.pxd | ||
) | ||
|
||
|
||
EXEC_PROGRAM("${PYTHON_EXECUTABLE}" | ||
ARGS "-c 'try:\n import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1,0,\"${CMAKE_INSTALL_PREFIX}\")\nexcept: pass\n'" | ||
OUTPUT_VARIABLE DISTUTILS_PYTHON_ILIBRARY_PATH | ||
) | ||
|
||
PYTHON_ADD_MODULE(cython_plist plist.c plist_util.c) | ||
SET_TARGET_PROPERTIES(cython_plist PROPERTIES PREFIX "" OUTPUT_NAME plist) | ||
TARGET_LINK_LIBRARIES(cython_plist plist ${PYTHON_LIBRARIES}) | ||
|
||
INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/plist${CMAKE_SHARED_MODULE_SUFFIX} | ||
DESTINATION ${DISTUTILS_PYTHON_ILIBRARY_PATH} ) | ||
INSTALL( FILES ${CMAKE_CURRENT_SOURCE_DIR}/plist.pxd | ||
DESTINATION include/plist/cython COMPONENT dev) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
cdef extern from "plist/plist.h": | ||
ctypedef void *plist_t | ||
ctypedef void *plist_dict_iter | ||
void plist_free(plist_t node) | ||
|
||
cdef class Node: | ||
cdef plist_t _c_node | ||
cdef bint _c_managed | ||
cpdef object __deepcopy__(self, memo=*) | ||
cpdef unicode to_xml(self) | ||
cpdef bytes to_bin(self) | ||
cpdef object copy(self) | ||
|
||
cdef class Bool(Node): | ||
cpdef set_value(self, object value) | ||
cpdef bint get_value(self) | ||
|
||
cdef class Integer(Node): | ||
cpdef set_value(self, object value) | ||
cpdef int get_value(self) | ||
|
||
cdef class Real(Node): | ||
cpdef set_value(self, object value) | ||
cpdef float get_value(self) | ||
|
||
cdef class String(Node): | ||
cpdef set_value(self, object value) | ||
cpdef unicode get_value(self) | ||
|
||
cdef class Date(Node): | ||
cpdef set_value(self, object value) | ||
cpdef object get_value(self) | ||
|
||
cdef class Data(Node): | ||
cpdef set_value(self, object value) | ||
cpdef bytes get_value(self) | ||
|
||
cdef class Dict(Node): | ||
cdef dict _map | ||
cdef void _init(self) | ||
cpdef set_value(self, dict value) | ||
cpdef dict get_value(self) | ||
cpdef bint has_key(self, key) | ||
cpdef object get(self, key, default=*) | ||
cpdef list keys(self) | ||
cpdef list items(self) | ||
cpdef list values(self) | ||
cpdef object iterkeys(self) | ||
cpdef object iteritems(self) | ||
cpdef object itervalues(self) | ||
|
||
cdef class Array(Node): | ||
cdef list _array | ||
cdef void _init(self) | ||
cpdef set_value(self, value) | ||
cpdef list get_value(self) | ||
cpdef append(self, object item) | ||
|
||
cpdef object from_xml(xml) | ||
cpdef object from_bin(bytes bin) | ||
|
||
cdef object plist_t_to_node(plist_t c_plist, bint managed=*) | ||
cdef plist_t native_to_plist_t(object native) |
Oops, something went wrong.