资源简介
在VS2013中MFC对话框使用JSONCPP解析JSON字符串,项目中有JSONCPP源代码文件和MFC对话框集成文件,项目亲测可以正常运行。
代码片段和文件信息
#!/usr/bin/env python
# encoding: utf-8
# Baptiste Lepilleur 2009
from dircache import listdir
import re
import fnmatch
import os.path
# These fnmatch expressions are used by default to prune the directory tree
# while doing the recursive traversal in the glob_impl method of glob function.
prune_dirs = ‘.git .bzr .hg .svn _MTN _darcs CVS SCCS ‘
# These fnmatch expressions are used by default to exclude files and dirs
# while doing the recursive traversal in the glob_impl method of glob function.
##exclude_pats = prune_pats + ‘*~ #*# .#* %*% ._* .gitignore .cvsignore vssver.scc .DS_Store‘.split()
# These ant_glob expressions are used by default to exclude files and dirs and also prune the directory tree
# while doing the recursive traversal in the glob_impl method of glob function.
default_excludes = ‘‘‘
**/*~
**/#*#
**/.#*
**/%*%
**/._*
**/CVS
**/CVS/**
**/.cvsignore
**/SCCS
**/SCCS/**
**/vssver.scc
**/.svn
**/.svn/**
**/.git
**/.git/**
**/.gitignore
**/.bzr
**/.bzr/**
**/.hg
**/.hg/**
**/_MTN
**/_MTN/**
**/_darcs
**/_darcs/**
**/.DS_Store ‘‘‘
DIR = 1
FILE = 2
DIR_link = 4
FILE_link = 8
linkS = DIR_link | FILE_link
ALL_NO_link = DIR | FILE
ALL = DIR | FILE | linkS
_ANT_RE = re.compile( r‘(/\*\*/)|(\*\*/)|(/\*\*)|(\*)|(/)|([^\*/]*)‘ )
def ant_pattern_to_re( ant_pattern ):
“““Generates a regular expression from the ant pattern.
Matching convention:
**/a: match ‘a‘ ‘dir/a‘ ‘dir1/dir2/a‘
a/**/b: match ‘a/b‘ ‘a/c/b‘ ‘a/d/c/b‘
*.py: match ‘script.py‘ but not ‘a/script.py‘
“““
rex = [‘^‘]
next_pos = 0
sep_rex = r‘(?:/|%s)‘ % re.escape( os.path.sep )
## print ‘Converting‘ ant_pattern
for match in _ANT_RE.finditer( ant_pattern ):
## print ‘Matched‘ match.group()
## print match.start(0) next_pos
if match.start(0) != next_pos:
raise ValueError( “Invalid ant pattern“ )
if match.group(1): # /**/
rex.append( sep_rex + ‘(?:.*%s)?‘ % sep_rex )
elif match.group(2): # **/
rex.append( ‘(?:.*%s)?‘ % sep_rex )
elif match.group(3): # /**
rex.append( sep_rex + ‘.*‘ )
elif match.group(4): # *
rex.append( ‘[^/%s]*‘ % re.escape(os.path.sep) )
elif match.group(5): # /
rex.append( sep_rex )
else: # somepath
rex.append( re.escape(match.group(6)) )
next_pos = match.end()
rex.append(‘$‘)
return re.compile( ‘‘.join( rex ) )
def _as_list( l ):
if isinstance(l basestring):
return l.split()
return l
def glob(dir_path
includes = ‘**/*‘
excludes = default_excludes
entry_type = FILE
prune_dirs = prune_dirs
max_depth = 25):
include_filter = [ant_pattern_to_re(p) for p in _as_list(includes)]
exclude_filter = [ant_pattern_to_re(p) for p in _as_list(excludes)]
prune_dirs = [p.replace(‘/‘os.path.sep) for p in _as_list(prune_dirs)]
dir_path = dir_path.replace(‘/‘os.path.sep)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-11-10 09:52 jsoncpp-src-0.5.0\
目录 0 2017-11-10 09:13 jsoncpp-src-0.5.0\build\
目录 0 2017-11-10 09:55 jsoncpp-src-0.5.0\build\vs71\
目录 0 2017-11-10 09:12 jsoncpp-src-0.5.0\devtools\
文件 7750 2010-03-12 15:31 jsoncpp-src-0.5.0\devtools\antglob.py
文件 1941 2010-03-12 15:31 jsoncpp-src-0.5.0\devtools\fixeol.py
文件 2071 2010-03-12 15:31 jsoncpp-src-0.5.0\devtools\tarball.py
文件 9 2010-03-12 15:31 jsoncpp-src-0.5.0\devtools\__init__.py
目录 0 2017-11-10 09:12 jsoncpp-src-0.5.0\doc\
文件 65086 2010-03-12 15:31 jsoncpp-src-0.5.0\doc\doxyfile.in
文件 572 2010-03-12 15:31 jsoncpp-src-0.5.0\doc\footer.html
文件 565 2010-03-12 15:31 jsoncpp-src-0.5.0\doc\header.html
文件 4242 2010-03-12 15:31 jsoncpp-src-0.5.0\doc\jsoncpp.dox
文件 71 2010-03-12 15:31 jsoncpp-src-0.5.0\doc\readme.txt
文件 1643 2010-03-12 15:31 jsoncpp-src-0.5.0\doc\roadmap.dox
目录 0 2017-11-10 09:12 jsoncpp-src-0.5.0\include\
目录 0 2017-11-10 09:12 jsoncpp-src-0.5.0\include\json\
文件 438 2010-03-12 15:31 jsoncpp-src-0.5.0\include\json\autoli
文件 1536 2010-03-12 15:31 jsoncpp-src-0.5.0\include\json\config.h
文件 1290 2010-03-12 15:31 jsoncpp-src-0.5.0\include\json\features.h
文件 735 2010-03-12 15:31 jsoncpp-src-0.5.0\include\json\forwards.h
文件 200 2010-03-12 15:31 jsoncpp-src-0.5.0\include\json\json.h
文件 6486 2010-03-12 15:31 jsoncpp-src-0.5.0\include\json\reader.h
文件 33960 2010-03-12 15:31 jsoncpp-src-0.5.0\include\json\value.h
文件 6188 2010-03-12 15:31 jsoncpp-src-0.5.0\include\json\writer.h
目录 0 2017-11-10 09:12 jsoncpp-src-0.5.0\makefiles\
目录 0 2017-11-10 09:55 jsoncpp-src-0.5.0\makefiles\vs71\
文件 2365 2017-11-10 09:12 jsoncpp-src-0.5.0\makefiles\vs71\jsoncpp.sln
文件 10752 2017-11-10 09:55 jsoncpp-src-0.5.0\makefiles\vs71\jsoncpp.v12.suo
文件 3112 2010-03-12 15:31 jsoncpp-src-0.5.0\makefiles\vs71\jsontest.vcproj
文件 5057 2017-11-10 09:12 jsoncpp-src-0.5.0\makefiles\vs71\jsontest.vcxproj
............此处省略186个文件信息
- 上一篇:学生信息管理系统C语言版本
- 下一篇:CC语言程序设计课后答案.doc
评论
共有 条评论