documentation polish. hide internal functions and types

This commit is contained in:
Arvid Norberg 2013-07-21 15:47:30 +00:00
parent eb6a964463
commit 2e911ee344
7 changed files with 25 additions and 26 deletions

View File

@ -74,8 +74,11 @@ def first_item(itr):
return None return None
def highlight_signature(s): def highlight_signature(s):
name = s.split('(')[0].split(' ')[-1].strip() name = s.split('(')
return s.replace(name, '<strong>' + name + '</strong>') name2 = name[0].split(' ')
name2[-1] = '<strong>' + name2[-1] + '</strong>'
name[0] = ' '.join(name2)
return '('.join(name)
def html_sanitize(s): def html_sanitize(s):
ret = '' ret = ''
@ -221,7 +224,7 @@ def parse_class(lno, lines, filename):
if looks_like_function(l): if looks_like_function(l):
current_fun, lno = parse_function(lno - 1, lines, filename) current_fun, lno = parse_function(lno - 1, lines, filename)
if current_fun != None: if current_fun != None and context.strip() != 'internal':
if context == '' and blanks == 0 and len(funs): if context == '' and blanks == 0 and len(funs):
funs[-1]['signatures'].update(current_fun['signatures']) funs[-1]['signatures'].update(current_fun['signatures'])
funs[-1]['names'].update(current_fun['names']) funs[-1]['names'].update(current_fun['names'])
@ -233,6 +236,9 @@ def parse_class(lno, lines, filename):
continue continue
if looks_like_variable(l): if looks_like_variable(l):
if context.strip() == 'internal':
context = ''
continue
n = l.split(' ')[-1].split(':')[0].split(';')[0] n = l.split(' ')[-1].split(':')[0].split(';')[0]
if context == '' and blanks == 0 and len(fields): if context == '' and blanks == 0 and len(fields):
fields[-1]['names'].append(n) fields[-1]['names'].append(n)
@ -245,7 +251,7 @@ def parse_class(lno, lines, filename):
if l.startswith('enum '): if l.startswith('enum '):
enum, lno = parse_enum(lno - 1, lines, filename) enum, lno = parse_enum(lno - 1, lines, filename)
if enum != None: if enum != None and context.strip() != 'internal':
enum['desc'] = context enum['desc'] = context
enums.append(enum) enums.append(enum)
context = '' context = ''
@ -300,7 +306,8 @@ def parse_enum(lno, lines, filename):
if verbose: print 'enumv %s' % lines[lno-1] if verbose: print 'enumv %s' % lines[lno-1]
for v in l.split(','): for v in l.split(','):
if v == '': continue if v == '': continue
values.append({'name': v.strip(), 'desc': context}) if context.strip() != 'internal':
values.append({'name': v.strip(), 'desc': context})
context = '' context = ''
else: else:
if verbose: print '?? %s' % lines[lno-1] if verbose: print '?? %s' % lines[lno-1]
@ -403,7 +410,7 @@ for filename in files:
if 'TORRENT_EXPORT ' in l: if 'TORRENT_EXPORT ' in l:
if 'class ' in l or 'struct ' in l: if 'class ' in l or 'struct ' in l:
current_class, lno = parse_class(lno -1, lines, filename) current_class, lno = parse_class(lno -1, lines, filename)
if current_class != None: if current_class != None and context.strip() != 'internal':
current_class['desc'] = context current_class['desc'] = context
classes.append(current_class) classes.append(current_class)
context = '' context = ''
@ -412,7 +419,7 @@ for filename in files:
if looks_like_function(l): if looks_like_function(l):
current_fun, lno = parse_function(lno - 1, lines, filename) current_fun, lno = parse_function(lno - 1, lines, filename)
if current_fun != None: if current_fun != None and context.strip() != 'internal':
if context == '' and blanks == 0 and len(functions): if context == '' and blanks == 0 and len(functions):
functions[-1]['signatures'].update(current_fun['signatures']) functions[-1]['signatures'].update(current_fun['signatures'])
functions[-1]['names'].update(current_fun['names']) functions[-1]['names'].update(current_fun['names'])
@ -431,7 +438,7 @@ for filename in files:
if l.startswith('enum '): if l.startswith('enum '):
current_enum, lno = parse_enum(lno - 1, lines, filename) current_enum, lno = parse_enum(lno - 1, lines, filename)
if current_enum != None: if current_enum != None and context.strip() != 'internal':
current_enum['desc'] = context current_enum['desc'] = context
enums.append(current_enum) enums.append(current_enum)
context = '' context = ''

View File

@ -77,14 +77,7 @@ div.section p, div.section ul, div.section dl {
#container { #container {
text-align: left; text-align: left;
width: 700px; width: 70em;
margin: 0 auto;
position: relative;
}
#container {
text-align: left;
width: 700px;
margin: 0 auto; margin: 0 auto;
position: relative; position: relative;
} }

View File

@ -217,6 +217,7 @@ namespace libtorrent
// on the torrent handle immediately after adding it. // on the torrent handle immediately after adding it.
flag_sequential_download = 0x800, flag_sequential_download = 0x800,
// internal
default_flags = flag_update_subscribe | flag_auto_managed | flag_paused | flag_apply_ip_filter default_flags = flag_update_subscribe | flag_auto_managed | flag_paused | flag_apply_ip_filter
#ifndef TORRENT_NO_DEPRECATE #ifndef TORRENT_NO_DEPRECATE
, flag_ignore_flags = 0x80000000 , flag_ignore_flags = 0x80000000

View File

@ -190,6 +190,7 @@ namespace libtorrent
int get_file_attributes(std::string const& p); int get_file_attributes(std::string const& p);
std::string get_symlink_path(std::string const& p); std::string get_symlink_path(std::string const& p);
// internal
TORRENT_EXPORT void add_files_impl(file_storage& fs, std::string const& p TORRENT_EXPORT void add_files_impl(file_storage& fs, std::string const& p
, std::string const& l, boost::function<bool(std::string)> pred , std::string const& l, boost::function<bool(std::string)> pred
, boost::uint32_t flags); , boost::uint32_t flags);

View File

@ -67,13 +67,10 @@ namespace libtorrent
std::string symlink_path; std::string symlink_path;
}; };
// this is used internally to hold the file entry // internal
// it's smaller and optimized for smaller memory
// footprint, as opposed to file_entry, which is
// optimized for convenience
// TODO: does this really need to be exported?
struct TORRENT_EXPORT internal_file_entry struct TORRENT_EXPORT internal_file_entry
{ {
// TODO: does this really need to be exported?
friend class file_storage; friend class file_storage;
#ifdef TORRENT_DEBUG #ifdef TORRENT_DEBUG
// for torrent_info::invariant_check // for torrent_info::invariant_check

View File

@ -295,7 +295,7 @@ namespace libtorrent
{ {
// replace any files in the destination when copying // replace any files in the destination when copying
// or moving the storage // or moving the storage
always_replace_files = 0, always_replace_files,
// if any files that we want to copy exist in the destination // if any files that we want to copy exist in the destination
// exist, fail the whole operation and don't perform // exist, fail the whole operation and don't perform
@ -304,11 +304,11 @@ namespace libtorrent
// the operation starts. In between the check and performing // the operation starts. In between the check and performing
// the copy, the destination files may be created, in which // the copy, the destination files may be created, in which
// case they are replaced. // case they are replaced.
fail_if_exist = 1, fail_if_exist,
// if any file exist in the target, take those files instead // if any file exist in the target, take those files instead
// of the ones we may have in the source. // of the ones we may have in the source.
dont_replace = 2, dont_replace,
}; };
struct disk_io_thread; struct disk_io_thread;

View File

@ -48,13 +48,13 @@ namespace libtorrent
// All pieces will be written to their final position, all files will be // All pieces will be written to their final position, all files will be
// allocated in full when the torrent is first started. This is done with // allocated in full when the torrent is first started. This is done with
// ``fallocate()`` and similar calls. This mode minimizes fragmentation. // ``fallocate()`` and similar calls. This mode minimizes fragmentation.
storage_mode_allocate = 0, storage_mode_allocate,
// All pieces will be written to the place where they belong and sparse files // All pieces will be written to the place where they belong and sparse files
// will be used. This is the recommended, and default mode. // will be used. This is the recommended, and default mode.
storage_mode_sparse, storage_mode_sparse,
// internal use only // internal
internal_storage_mode_compact_deprecated, internal_storage_mode_compact_deprecated,
#ifndef TORRENT_NO_DEPRECATE #ifndef TORRENT_NO_DEPRECATE
storage_mode_compact = internal_storage_mode_compact_deprecated storage_mode_compact = internal_storage_mode_compact_deprecated