'All', 'categorized' => 'Categorized' ); static $filter_fields = Array( 'std-proposal' => 'Standard Proposals', 'std-tr1' => 'TR1 libraries', 'header-only' => '[old]', 'autolink' => '[old]' ); static $sort_fields = Array( 'name' => 'Name', 'boost-version' => 'First Release', 'std-proposal' => 'STD Proposal', 'std-tr1' => 'STD::TR1', 'key' => 'Key' ); static $display_sort_fields = Array( '' => 'Name', 'boost-version' => 'First Release' ); var $params; var $libs; var $categories; var $base_uri = ''; var $view_value = ''; var $category_value = ''; var $filter_value = ''; var $sort_value = 'name'; var $attribute_filter = false; function __construct($params, $libs) { $this->params = $params; $this->libs = $libs; $this->categories = $libs->get_categories(); $this->base_uri = preg_replace('![#?].*!', '', $_SERVER['REQUEST_URI']); if (isset($params['view'])) { $this->view_value = $params['view']; } if (strpos($this->view_value, 'filtered_') === 0) { $this->filter_value = substr($this->view_value, strlen('filtered_')); if (!isset(self::$filter_fields[$this->filter_value])) { echo 'Invalid filter field.'; exit(0); } if (self::$filter_fields[$this->filter_value] == '[old]') { echo 'Filter field no longer supported.'; exit(0); } } else if (strpos($this->view_value, 'category_') === 0) { $this->category_value = substr($this->view_value, strlen('category_')); if(!isset($this->categories[$this->category_value])) { echo 'Invalid category: '.htmlentities($this->category_value); exit(0); } } else { $this->filter_value = ''; if (!isset(self::$view_fields[$this->view_value])) { echo 'Invalid view value.'; exit(0); } } if (!empty($params['sort'])) { $this->sort_value = $params['sort']; if (!isset(self::$sort_fields[$this->sort_value])) { echo 'Invalid sort field.'; exit(0); } } if (!empty($params['filter'])) { $this->attribute_filter = $params['filter']; } } function filter($lib) { if ($this->filter_value && empty($lib[$this->filter_value])) { return false; } if ($this->attribute_filter && empty($lib[$this->attribute_filter])) { return false; } if ($this->category_value && (empty($lib['category']) || !in_array($this->category_value, $lib['category']))) { return false; } return true; } function title() { $page_title = BoostVersion::page_title().' Library Documentation'; if ($this->category_value) { $page_title.= ' - '. $this->categories[$this->category_value]['title']; } return $page_title; } function category_subtitle() { if($this->category_value) { echo '

', htmlentities($this->categories[$this->category_value]['title']), '

'; } } function view_menu_items() { foreach (self::$view_fields as $key => $description) { echo '
  • '; $this->option_link($description, 'view', $key); echo '
  • '; } } function filter_menu_items() { foreach (self::$filter_fields as $key => $description) { if (!preg_match('@^\[.*\]$@', $description)) { echo '
  • '; $this->option_link($description, 'view', 'filtered_'.$key); echo '
  • '; } } } function sort_menu_items() { foreach (self::$display_sort_fields as $key => $description) { echo '
  • '; $this->option_link($description, 'sort', $key); echo '
  • '; } } function filtered_libraries() { return $this->libs->get_for_version(BoostVersion::page(), $this->sort_value, array($this, 'filter')); } function categorized_libraries() { return $this->libs->get_categorized_for_version(BoostVersion::page(), $this->sort_value, array($this, 'filter')); } // Library display functions: function libref($lib) { if (!empty($lib['documentation'])) { $path_info = filter_input(INPUT_SERVER, 'PATH_INFO', FILTER_SANITIZE_URL); if ($path_info && $path_info != '/') { $docref = '/doc/libs' . $path_info . '/' . $lib['documentation']; } else { $docref = '/doc/libs/release/' . $lib['documentation']; } print '' . htmlentities(!empty($lib['name']) ? $lib['name'] : $lib['key']) . ''; } else { print htmlentities(!empty($lib['name']) ? $lib['name'] : $lib['key']); } if (!empty($lib['status'])) { print ' (' . htmlentities($lib['status']) . ')'; } } function libdescription($lib) { echo !empty($lib['description']) ? htmlentities($lib['description'],ENT_NOQUOTES,'UTF-8') : ' '; } function libauthors($lib) { print !empty($lib['authors']) ? htmlentities($lib['authors']) : ' '; } function libavailable($lib) { print !empty($lib['boost-version']) ? htmlentities($lib['boost-version']) : 'unreleased'; } function libstandard($lib) { $p = array(); if ($lib['std-proposal']) { $p[] = 'Proposed'; } if ($lib['std-tr1']) { $p[] = 'TR1'; } print ($p ? implode(', ', $p) : ' '); } function libcategories($lib) { $first = true; if ($lib['category']) { foreach ($lib['category'] as $category_name) { if (!$first) echo ', '; $first = false; $this->category_link($category_name); } } if ($first) echo ' '; } function option_link($description, $field, $value) { $current_value = isset($this->params[$field]) ? $this->params[$field] : ''; if ($current_value == $value) { echo '', htmlentities($description), ''; } else { $params = $this->params; $params[$field] = $value; $url_params = ''; foreach ($params as $k => $v) { if ($v) { $url_params .= $url_params ? '&' : '?'; $url_params .= urlencode($k) . '=' . urlencode($v); } } echo '', htmlentities($description), ''; } } function category_link($name) { $category = $this->categories[$name]; $this->option_link( isset($category['title']) ? $category['title'] : $name, 'view', 'category_' . $name); } } // Page variables $library_page = new LibraryPage($_GET, USE_SERIALIZED_INFO ? unserialize(file_get_contents(dirname(__FILE__) . '/../generated/libraries.txt')) : boost_libraries::from_xml_file(dirname(__FILE__) . '/libraries.xml')); ?> <?php echo htmlentities($library_page->title()); ?>

    title()); ?>

    Sort by:
    view_value != 'categorized'): ?> category_subtitle(); ?>
    filtered_libraries() as $lib): ?>
    libref($lib); ?>

    libdescription($lib); ?>

    Author(s)
    libauthors($lib); ?>
    First Release
    libavailable($lib); ?>
    Standard
    libstandard($lib); ?>
    Categories
    libcategories($lib); ?>

    By Category

    categorized_libraries() as $name => $category) { if(count($category['libraries'])) { echo '

    '; $library_page->category_link($name); echo '

    '; echo '
      '; foreach ($category['libraries'] as $lib) { echo '
    • '; $library_page->libref($lib); echo ': '; $library_page->libdescription($lib); echo '
    • '; } echo '
    '; } } ?>