text:
package org.kie.workbench.common.widgets.decoratedgrid.client.resources;

import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.CssResource;
import com.google.gwt.resources.client.ImageResource;
import org.kie.workbench.common.widgets.client.resources.CollapseExpand;
import org.kie.workbench.common.widgets.client.resources.ItemImages;

/**
 * Resources for the Decision Table.
 */
public interface GridResources
        extends
        ClientBundle {

    GridResources INSTANCE = GWT.create( GridResources.class );

    interface GridStyle
            extends
            CssResource {

        int rowHeight();

        int rowHeaderHeight();

        int rowHeaderSplitterHeight();

        int rowHeaderSorterHeight();

        int sidebarWidth();

        int borderWidth();

        int borderWidthThick();

        String cellTable();

        String cellTableEvenRow();

        String cellTableOddRow();

        String cellTableCell();

        String cellTableCellSelected();

        String cellTableCellMultipleValues();

        String cellTableCellOtherwise();

        String cellTableCellDiv();

        String cellTableGroupDiv();

        String cellTableTextDiv();

        String headerRowBottom();

        String headerRowIntermediate();

        String headerText();

        String headerSplitter();

        String headerResizer();

        String selectorSpacer();

        String selectorSpacerOuterDiv();

        String selectorSpacerInnerDiv();

        String selectorCell();

        String contextMenu();

        String contextMenuItem();

        String contextMenuItemEnabled();

        String contextMenuItemDisabled();

    }

    @Source("images/emptyArrow.png")
    ImageResource arrowSpacerIcon();

    TableImageResources tableImageResources();

    @Source("images/icon-unmerge.png")
    ImageResource toggleUnmergeIcon();

    @Source("images/icon-merge.png")
    ImageResource toggleMergeIcon();

    ItemImages itemImages();

    CollapseExpand collapseExpand();

    @Source({ "css/grid.css" })
    GridStyle style();

}


text:
#pragma once
#include <aws/budgets/Budgets_EXPORTS.h>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace Budgets
{
namespace Model
{

  /**
   *
The parameters that define or describe the historical data that your
   * auto-adjusting budget is based on.

See Also:
   AWS
   * API Reference

   */
  class AWS_BUDGETS_API HistoricalOptions
  {
  public:
    HistoricalOptions();
    HistoricalOptions(Aws::Utils::Json::JsonView jsonValue);
    HistoricalOptions& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
The number of budget periods included in the moving-average calculation that
     * determines your auto-adjusted budget amount. The maximum value depends on the
     * TimeUnit granularity of the budget:

For the
     * DAILY granularity, the maximum value is 60.

     *

For the MONTHLY granularity, the maximum value is
     * 12.

For the QUARTERLY granularity,
     * the maximum value is 4.

For the
     * ANNUALLY granularity, the maximum value is 1.

     *

     */
    inline int GetBudgetAdjustmentPeriod() const{ return m_budgetAdjustmentPeriod; }

    /**
     *
The number of budget periods included in the moving-average calculation that
     * determines your auto-adjusted budget amount. The maximum value depends on the
     * TimeUnit granularity of the budget:

For the
     * DAILY granularity, the maximum value is 60.

     *

For the MONTHLY granularity, the maximum value is
     * 12.

For the QUARTERLY granularity,
     * the maximum value is 4.

For the
     * ANNUALLY granularity, the maximum value is 1.

     *

     */
    inline bool BudgetAdjustmentPeriodHasBeenSet() const { return m_budgetAdjustmentPeriodHasBeenSet; }

    /**
     *
The number of budget periods included in the moving-average calculation that
     * determines your auto-adjusted budget amount. The maximum value depends on the
     * TimeUnit granularity of the budget:

For the
     * DAILY granularity, the maximum value is 60.

     *

For the MONTHLY granularity, the maximum value is
     * 12.

For the QUARTERLY granularity,
     * the maximum value is 4.

For the
     * ANNUALLY granularity, the maximum value is 1.

     *

     */
    inline void SetBudgetAdjustmentPeriod(int value) { m_budgetAdjustmentPeriodHasBeenSet = true; m_budgetAdjustmentPeriod = value; }

    /**
     *
The number of budget periods included in the moving-average calculation that
     * determines your auto-adjusted budget amount. The maximum value depends on the
     * TimeUnit granularity of the budget:

For the
     * DAILY granularity, the maximum value is 60.

     *

For the MONTHLY granularity, the maximum value is
     * 12.

For the QUARTERLY granularity,
     * the maximum value is 4.

For the
     * ANNUALLY granularity, the maximum value is 1.

     *

     */
    inline HistoricalOptions& WithBudgetAdjustmentPeriod(int value) { SetBudgetAdjustmentPeriod(value); return *this;}

    /**
     *
The integer that describes how many budget periods in your
     * BudgetAdjustmentPeriod are included in the calculation of your
     * current BudgetLimit. If the first budget period in your
     * BudgetAdjustmentPeriod has no cost data, then that budget period
     * isn't included in the average that determines your budget limit.

For
     * example, if you set BudgetAdjustmentPeriod as 4
     * quarters, but your account had no cost data in the first quarter, then only the
     * last three quarters are included in the calculation. In this scenario,
     * LookBackAvailablePeriods returns 3.

You can't
     * set your own LookBackAvailablePeriods. The value is automatically
     * calculated from the BudgetAdjustmentPeriod and your historical cost
     * data.

     */
    inline int GetLookBackAvailablePeriods() const{ return m_lookBackAvailablePeriods; }

    /**
     *
The integer that describes how many budget periods in your
     * BudgetAdjustmentPeriod are included in the calculation of your
     * current BudgetLimit. If the first budget period in your
     * BudgetAdjustmentPeriod has no cost data, then that budget period
     * isn't included in the average that determines your budget limit.

For
     * example, if you set BudgetAdjustmentPeriod as 4
     * quarters, but your account had no cost data in the first quarter, then only the
     * last three quarters are included in the calculation. In this scenario,
     * LookBackAvailablePeriods returns 3.

You can't
     * set your own LookBackAvailablePeriods. The value is automatically
     * calculated from the BudgetAdjustmentPeriod and your historical cost
     * data.

     */
    inline bool LookBackAvailablePeriodsHasBeenSet() const { return m_lookBackAvailablePeriodsHasBeenSet; }

    /**
     *
The integer that describes how many budget periods in your
     * BudgetAdjustmentPeriod are included in the calculation of your
     * current BudgetLimit. If the first budget period in your
     * BudgetAdjustmentPeriod has no cost data, then that budget period
     * isn't included in the average that determines your budget limit.

For
     * example, if you set BudgetAdjustmentPeriod as 4
     * quarters, but your account had no cost data in the first quarter, then only the
     * last three quarters are included in the calculation. In this scenario,
     * LookBackAvailablePeriods returns 3.

You can't
     * set your own LookBackAvailablePeriods. The value is automatically
     * calculated from the BudgetAdjustmentPeriod and your historical cost
     * data.

     */
    inline void SetLookBackAvailablePeriods(int value) { m_lookBackAvailablePeriodsHasBeenSet = true; m_lookBackAvailablePeriods = value; }

    /**
     *
The integer that describes how many budget periods in your
     * BudgetAdjustmentPeriod are included in the calculation of your
     * current BudgetLimit. If the first budget period in your
     * BudgetAdjustmentPeriod has no cost data, then that budget period
     * isn't included in the average that determines your budget limit.

For
     * example, if you set BudgetAdjustmentPeriod as 4
     * quarters, but your account had no cost data in the first quarter, then only the
     * last three quarters are included in the calculation. In this scenario,
     * LookBackAvailablePeriods returns 3.

You can't
     * set your own LookBackAvailablePeriods. The value is automatically
     * calculated from the BudgetAdjustmentPeriod and your historical cost
     * data.

     */
    inline HistoricalOptions& WithLookBackAvailablePeriods(int value) { SetLookBackAvailablePeriods(value); return *this;}

  private:

    int m_budgetAdjustmentPeriod;
    bool m_budgetAdjustmentPeriodHasBeenSet;

    int m_lookBackAvailablePeriods;
    bool m_lookBackAvailablePeriodsHasBeenSet;
  };

} // namespace Model
} // namespace Budgets
} // namespace Aws

redpajama_set_name: RedPajamaGithub


text:
<?php

if (is_file(dirname(__FILE__).'/../CodeSniffer.php') === true) {
    include_once dirname(__FILE__).'/../CodeSniffer.php';
} else {
    include_once 'PHP/CodeSniffer.php';
}

/**
 * A class to process command line phpcs scripts.
 *
 * @category  PHP
 * @package   PHP_CodeSniffer
 * @author    Greg Sherwood <gsherwood@squiz.net>
 * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600)
 * @license   https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
 * @version   Release: @package_version@
 * @link      http://pear.php.net/package/PHP_CodeSniffer
 */
class PHP_CodeSniffer_CLI
{

    /**
     * An array of all values specified on the command line.
     *
     * @var array
     */
    protected $values = array();

    /**
     * The minimum severity level errors must have to be displayed.
     *
     * @var bool
     */
    public $errorSeverity = 0;

    /**
     * The minimum severity level warnings must have to be displayed.
     *
     * @var bool
     */
    public $warningSeverity = 0;

    /**
     * Whether or not to kill the process when an unknown command line arg is found.
     *
     * If FALSE, arguments that are not command line options or file/directory paths
     * will be ignored and execution will continue.
     *
     * @var bool
     */
    public $dieOnUnknownArg = true;

    /**
     * Exits if the minimum requirements of PHP_CodSniffer are not met.
     *
     * @return array
     */
    public function checkRequirements()
    {
        // Check the PHP version.
        if (version_compare(PHP_VERSION, '5.1.2') === -1) {
            echo 'ERROR: PHP_CodeSniffer requires PHP version 5.1.2 or greater.'.PHP_EOL;
            exit(2);
        }

        if (extension_loaded('tokenizer') === false) {
            echo 'ERROR: PHP_CodeSniffer requires the tokenizer extension to be enabled.'.PHP_EOL;
            exit(2);
        }

    }//end checkRequirements()

    /**
     * Get a list of default values for all possible command line arguments.
     *
     * @return array
     */
    public function getDefaults()
    {
        // The default values for config settings.
        $defaults['files']           = array();
        $defaults['standard']        = null;
        $defaults['verbosity']       = 0;
        $defaults['interactive']     = false;
        $defaults['explain']         = false;
        $defaults['local']           = false;
        $defaults['showSources']     = false;
        $defaults['extensions']      = array();
        $defaults['sniffs']          = array();
        $defaults['ignored']         = array();
        $defaults['reportFile']      = null;
        $defaults['generator']       = '';
        $defaults['reports']         = array();
        $defaults['errorSeverity']   = null;
        $defaults['warningSeverity'] = null;

        $reportFormat = PHP_CodeSniffer::getConfigData('report_format');
        if ($reportFormat !== null) {
            $defaults['reports'][$reportFormat] = null;
        }

        $tabWidth = PHP_CodeSniffer::getConfigData('tab_width');
        if ($tabWidth === null) {
            $defaults['tabWidth'] = 0;
        } else {
            $defaults['tabWidth'] = (int) $tabWidth;
        }

        $encoding = PHP_CodeSniffer::getConfigData('encoding');
        if ($encoding === null) {
            $defaults['encoding'] = 'iso-8859-1';
        } else {
            $defaults['encoding'] = strtolower($encoding);
        }

        $severity = PHP_CodeSniffer::getConfigData('severity');
        if ($severity !== null) {
            $defaults['errorSeverity']   = (int) $severity;
            $defaults['warningSeverity'] = (int) $severity;
        }

        $severity = PHP_CodeSniffer::getConfigData('error_severity');
        if ($severity !== null) {
            $defaults['errorSeverity'] = (int) $severity;
        }

        $severity = PHP_CodeSniffer::getConfigData('warning_severity');
        if ($severity !== null) {
            $defaults['warningSeverity'] = (int) $severity;
        }

        $showWarnings = PHP_CodeSniffer::getConfigData('show_warnings');
        if ($showWarnings !== null) {
            $showWarnings = (bool) $showWarnings;
            if ($showWarnings === false) {
                $defaults['warningSeverity'] = 0;
            }
        }

        $reportWidth = PHP_CodeSniffer::getConfigData('report_width');
        if ($reportWidth === null) {
            $defaults['reportWidth'] = 80;
        } else {
            $defaults['reportWidth'] = (int) $reportWidth;
        }

        $showProgress = PHP_CodeSniffer::getConfigData('show_progress');
        if ($showProgress === null) {
            $defaults['showProgress'] = false;
        } else {
            $defaults['showProgress'] = (bool) $showProgress;
        }

        return $defaults;

    }//end getDefaults()

    /**
     * Process the command line arguments and returns the values.
     *
     * @return array
     */
    public function getCommandLineValues()
    {
        if (defined('PHP_CODESNIFFER_IN_TESTS') === true) {
            return array();
        }

        if (empty($this->values) === false) {
            return $this->values;
        }

        $values = $this->getDefaults();

        for ($i = 1; $i < $_SERVER['argc']; $i++) {
            $arg = $_SERVER['argv'][$i];
            if ($arg === '') {
                continue;
            }

            if ($arg{0} === '-') {
                if ($arg === '-' || $arg === '--') {
                    // Empty argument, ignore it.
                    continue;
                }

                if ($arg{1} === '-') {
                    $values
                        = $this->processLongArgument(substr($arg, 2), $i, $values);
                } else {
                    $switches = str_split($arg);
                    foreach ($switches as $switch) {
                        if ($switch === '-') {
                            continue;
                        }

                        $values = $this->processShortArgument($switch, $i, $values);
                    }
                }
            } else {
                $values = $this->processUnknownArgument($arg, $i, $values);
            }//end if
        }//end for

        $this->values = $values;
        return $values;

    }//end getCommandLineValues()

    /**
     * Processes a short (-e) command line argument.
     *
     * @param string $arg    The command line argument.
     * @param int    $pos    The position of the argument on the command line.
     * @param array  $values An array of values determined from CLI args.
     *
     * @return array The updated CLI values.
     * @see getCommandLineValues()
     */
    public function processShortArgument($arg, $pos, $values)
    {
        switch ($arg) {
        case 'h':
        case '?':
            $this->printUsage();
            exit(0);
            break;
        case 'i' :
            $this->printInstalledStandards();
            exit(0);
            break;
        case 'v' :
            $values['verbosity']++;
            break;
        case 'l' :
            $values['local'] = true;
            break;
        case 's' :
            $values['showSources'] = true;
            break;
        case 'a' :
            $values['interactive'] = true;
            break;
        case 'e':
            $values['explain'] = true;
            break;
        case 'p' :
            $values['showProgress'] = true;
            break;
        case 'd' :
            $ini = explode('=', $_SERVER['argv'][($pos + 1)]);
            $_SERVER['argv'][($pos + 1)] = '';
            if (isset($ini[1]) === true) {
                ini_set($ini[0], $ini[1]);
            } else {
                ini_set($ini[0], true);
            }

            break;
        case 'n' :
            $values['warningSeverity'] = 0;
            break;
        case 'w' :
            $values['warningSeverity'] = null;
            break;
        default:
            $values = $this->processUnknownArgument('-'.$arg, $pos, $values);
        }//end switch

        return $values;

    }//end processShortArgument()

    /**
     * Processes a long (--example) command line argument.
     *
     * @param string $arg    The command line argument.
     * @param int    $pos    The position of the argument on the command line.
     * @param array  $values An array of values determined from CLI args.
     *
     * @return array The updated CLI values.
     * @see getCommandLineValues()
     */
    public function processLongArgument($arg, $pos, $values)
    {
        switch ($arg) {
        case 'help':
            $this->printUsage();
            exit(0);
            break;
        case 'version':
            echo 'PHP_CodeSniffer version @package_version@ (@package_state@) ';
            echo 'by Squiz Pty Ltd. (http://www.squiz.com.au)'.PHP_EOL;
            exit(0);
            break;
        case 'config-set':
            $key   = $_SERVER['argv'][($pos + 1)];
            $value = $_SERVER['argv'][($pos + 2)];
            PHP_CodeSniffer::setConfigData($key, $value);
            exit(0);
            break;
        case 'config-delete':
            $key = $_SERVER['argv'][($pos + 1)];
            PHP_CodeSniffer::setConfigData($key, null);
            exit(0);
            break;
        case 'config-show':
            $data = PHP_CodeSniffer::getAllConfigData();
            print_r($data);
            exit(0);
            break;
        default:
            if (substr($arg, 0, 7) === 'sniffs=') {
                $values['sniffs'] = array();

                $sniffs = substr($arg, 7);
                $sniffs = explode(',', $sniffs);

                // Convert the sniffs to class names.
                foreach ($sniffs as $sniff) {
                    $parts = explode('.', $sniff);
                    $values['sniffs'][] = $parts[0].'_Sniffs_'.$parts[1].'_'.$parts[2].'Sniff';
                }
            } else if (substr($arg, 0, 12) === 'report-file=') {
                $values['reportFile'] = realpath(substr($arg, 12));

                // It may not exist and return false instead.
                if ($values['reportFile'] === false) {
                    $values['reportFile'] = substr($arg, 12);
                }

                if (is_dir($values['reportFile']) === true) {
                    echo 'ERROR: The specified report file path "'.$values['reportFile'].'" is a directory.'.PHP_EOL.PHP_EOL;
                    $this->printUsage();
                    exit(2);
                }

                $dir = dirname($values['reportFile']);
                if (is_dir($dir) === false) {
                    echo 'ERROR: The specified report file path "'.$values['reportFile'].'" points to a non-existent directory.'.PHP_EOL.PHP_EOL;
                    $this->printUsage();
                    exit(2);
                }
            } else if (substr($arg, 0, 13) === 'report-width=') {
                $values['reportWidth'] = (int) substr($arg, 13);
            } else if (substr($arg, 0, 7) === 'report='
                || substr($arg, 0, 7) === 'report-'
            ) {
                if ($arg[6] === '-') {
                    // This is a report with file output.
                    $split = strpos($arg, '=');
                    if ($split === false) {
                        $report = substr($arg, 7);
                        $output = null;
                    } else {
                        $report = substr($arg, 7, ($split - 7));
                        $output = substr($arg, ($split + 1));
                        if ($output === false) {
                            $output = null;
                        }
                    }
                } else {
                    // This is a single report.
                    $report = substr($arg, 7);
                    $output = null;
                }

                $validReports = array(
                                 'full',
                                 'xml',
                                 'json',
                                 'checkstyle',
                                 'csv',
                                 'emacs',
                                 'notifysend',
                                 'source',
                                 'summary',
                                 'svnblame',
                                 'gitblame',
                                 'hgblame',
                                );

                if (in_array($report, $validReports) === false) {
                    echo 'ERROR: Report type "'.$report.'" not known.'.PHP_EOL;
                    exit(2);
                }

                $values['reports'][$report] = $output;
            } else if (substr($arg, 0, 9) === 'standard=') {
                $values['standard'] = substr($arg, 9);
            } else if (substr($arg, 0, 11) === 'extensions=') {
                $values['extensions'] = explode(',', substr($arg, 11));
            } else if (substr($arg, 0, 9) === 'severity=') {
                $values['errorSeverity']   = (int) substr($arg, 9);
                $values['warningSeverity'] = $values['errorSeverity'];
            } else if (substr($arg, 0, 15) === 'error-severity=') {
                $values['errorSeverity'] = (int) substr($arg, 15);
            } else if (substr($arg, 0, 17) === 'warning-severity=') {
                $values['warningSeverity'] = (int) substr($arg, 17);
            } else if (substr($arg, 0, 7) === 'ignore=') {
                // Split the ignore string on commas, unless the comma is escaped
                // using 1 or 3 slashes (\, or \\\,).
                $ignored = preg_split(
                    '/(?<=(?<!\\\\)\\\\\\\\),|(?<!\\\\),/',
                    substr($arg, 7)
                );
                foreach ($ignored as $pattern) {
                    $values['ignored'][$pattern] = 'absolute';
                }
            } else if (substr($arg, 0, 10) === 'generator=') {
                $values['generator'] = substr($arg, 10);
            } else if (substr($arg, 0, 9) === 'encoding=') {
                $values['encoding'] = strtolower(substr($arg, 9));
            } else if (substr($arg, 0, 10) === 'tab-width=') {
                $values['tabWidth'] = (int) substr($arg, 10);
            } else {
                $values = $this->processUnknownArgument('--'.$arg, $pos, $values);
            }//end if

            break;
        }//end switch

        return $values;

    }//end processLongArgument()

    /**
     * Processes an unknown command line argument.
     *
     * Assumes all unknown arguments are files and folders to check.
     *
     * @param string $arg    The command line argument.
     * @param int    $pos    The position of the argument on the command line.
     * @param array  $values An array of values determined from CLI args.
     *
     * @return array The updated CLI values.
     * @see getCommandLineValues()
     */
    public function processUnknownArgument($arg, $pos, $values)
    {
        // We don't know about any additional switches; just files.
        if ($arg{0} === '-') {
            if ($this->dieOnUnknownArg === false) {
                return $values;
            }

            echo 'ERROR: option "'.$arg.'" not known.'.PHP_EOL.PHP_EOL;
            $this->printUsage();
            exit(2);
        }

        $file = realpath($arg);
        if (file_exists($file) === false) {
            if ($this->dieOnUnknownArg === false) {
                return $values;
            }

            echo 'ERROR: The file "'.$arg.'" does not exist.'.PHP_EOL.PHP_EOL;
            $this->printUsage();
            exit(2);
        } else {
            $values['files'][] = $file;
        }

        return $values;

    }//end processUnknownArgument()

    /**
     * Runs PHP_CodeSniffer over files and directories.
     *
     * @param array $values An array of values determined from CLI args.
     *
     * @return int The number of error and warning messages shown.
     * @see getCommandLineValues()
     */
    public function process($values=array())
    {
        if (empty($values) === true) {
            $values = $this->getCommandLineValues();
        }

        if ($values['generator'] !== '') {
            $phpcs = new PHP_CodeSniffer($values['verbosity']);
            $phpcs->generateDocs(
                $values['standard'],
                $values['files'],
                $values['generator']
            );
            exit(0);
        }

        $values['standard'] = $this->validateStandard($values['standard']);
        if (PHP_CodeSniffer::isInstalledStandard($values['standard']) === false) {
            // They didn't select a valid coding standard, so help them
            // out by letting them know which standards are installed.
            echo 'ERROR: the "'.$values['standard'].'" coding standard is not installed. ';
            $this->printInstalledStandards();
            exit(2);
        }

        if ($values['explain'] === true) {
            $this->explainStandard($values['standard']);
            exit(0);
        }

        $fileContents = '';
        if (empty($values['files']) === true) {
            // Check if they passing in the file contents.
            $handle       = fopen('php://stdin', 'r');
            $fileContents = stream_get_contents($handle);
            fclose($handle);

            if ($fileContents === '') {
                // No files and no content passed in.
                echo 'ERROR: You must supply at least one file or directory to process.'.PHP_EOL.PHP_EOL;
                $this->printUsage();
                exit(2);
            }
        }

        $phpcs = new PHP_CodeSniffer(
            $values['verbosity'],
            $values['tabWidth'],
            $values['encoding'],
            $values['interactive']
        );

        // Set file extensions if they were specified. Otherwise,
        // let PHP_CodeSniffer decide on the defaults.
        if (empty($values['extensions']) === false) {
            $phpcs->setAllowedFileExtensions($values['extensions']);
        }

        // Set ignore patterns if they were specified.
        if (empty($values['ignored']) === false) {
            $phpcs->setIgnorePatterns($values['ignored']);
        }

        // Set some convenience member vars.
        if ($values['errorSeverity'] === null) {
            $this->errorSeverity = PHPCS_DEFAULT_ERROR_SEV;
        } else {
            $this->errorSeverity = $values['errorSeverity'];
        }

        if ($values['warningSeverity'] === null) {
            $this->warningSeverity = PHPCS_DEFAULT_WARN_SEV;
        } else {
            $this->warningSeverity = $values['warningSeverity'];
        }

        $phpcs->setCli($this);

        $phpcs->process(
            $values['files'],
            $values['standard'],
            $values['sniffs'],
            $values['local']
        );

        if ($fileContents !== '') {
            $phpcs->processFile('STDIN', $fileContents);
        }

        return $this->printErrorReport(
            $phpcs,
            $values['reports'],
            $values['showSources'],
            $values['reportFile'],
            $values['reportWidth']
        );

    }//end process()

    /**
     * Prints the error report for the run.
     *
     * Note that this function may actually print multiple reports
     * as the user may have specified a number of output formats.
     *
     * @param PHP_CodeSniffer $phpcs       The PHP_CodeSniffer object containing
     *                                     the errors.
     * @param array           $reports     A list of reports to print.
     * @param bool            $showSources TRUE if report should show error sources
     *                                     (not used by all reports).
     * @param string          $reportFile  A default file to log report output to.
     * @param int             $reportWidth How wide the screen reports should be.
     *
     * @return int The number of error and warning messages shown.
     */
    public function printErrorReport(
        PHP_CodeSniffer $phpcs,
        $reports,
        $showSources,
        $reportFile,
        $reportWidth
    ) {
        $reporting       = new PHP_CodeSniffer_Reporting();
        $filesViolations = $phpcs->getFilesErrors();

        if (empty($reports) === true) {
            $reports['full'] = $reportFile;
        }

        $errors   = 0;
        $toScreen = false;

        foreach ($reports as $report => $output) {
            if ($output === null) {
                $output = $reportFile;
            }

            if ($reportFile === null) {
                $toScreen = true;
            }

            // We don't add errors here because the number of
            // errors reported by each report type will always be the
            // same, so we really just need 1 number.
            $errors = $reporting->printReport(
                $report,
                $filesViolations,
                $showSources,
                $output,
                $reportWidth
            );
        }

        // Only print PHP_Timer output if no reports were
        // printed to the screen so we don't put additional output
        // in something like an XML report. If we are printing to screen,
        // the report types would have already worked out who should
        // print the timer info.
        if ($toScreen === false
            && PHP_CODESNIFFER_INTERACTIVE === false
            && class_exists('PHP_Timer', false) === true
        ) {
            echo PHP_Timer::resourceUsage().PHP_EOL.PHP_EOL;
        }

        // They should all return the same value, so it
        // doesn't matter which return value we end up using.
        return $errors;

    }//end printErrorReport()

    /**
     * Convert the passed standard into a valid standard.
     *
     * Checks things like default values and case.
     *
     * @param string $standard The standard to validate.
     *
     * @return string
     */
    public function validateStandard($standard)
    {
        if ($standard === null) {
            // They did not supply a standard to use.
            // Try to get the default from the config system.
            $standard = PHP_CodeSniffer::getConfigData('default_standard');
            if ($standard === null) {
                $standard = 'PEAR';
            }
        }

        // Check if the standard name is valid. If not, check that the case
        // was not entered incorrectly.
        if (PHP_CodeSniffer::isInstalledStandard($standard) === false) {
            $installedStandards = PHP_CodeSniffer::getInstalledStandards();
            foreach ($installedStandards as $validStandard) {
                if (strtolower($standard) === strtolower($validStandard)) {
                    $standard = $validStandard;
                    break;
                }
            }
        }

        return $standard;

    }//end validateStandard()

    /**
     * Prints a report showing the sniffs contained in a standard.
     *
     * @param string $standard The standard to validate.
     *
     * @return void
     */
    public function explainStandard($standard)
    {
        $phpcs = new PHP_CodeSniffer();
        $phpcs->setTokenListeners($standard);
        $sniffs = $phpcs->getSniffs();
        $sniffs = array_keys($sniffs);
        sort($sniffs);

        ob_start();

        $lastStandard = '';
        $lastCount    = '';
        $sniffCount   = count($sniffs);
        $sniffs[]     = '___';

        echo PHP_EOL."The $standard standard contains $sniffCount sniffs".PHP_EOL;

        ob_start();

        foreach ($sniffs as $sniff) {
            $parts = explode('_', str_replace('\\', '_', $sniff));
            if ($lastStandard === '') {
                $lastStandard = $parts[0];
            }

            if ($parts[0] !== $lastStandard) {
                $sniffList = ob_get_contents();
                ob_end_clean();

                echo PHP_EOL.$lastStandard.' ('.$lastCount.' sniffs)'.PHP_EOL;
                echo str_repeat('-', strlen($lastStandard.$lastCount) + 10);
                echo PHP_EOL;
                echo $sniffList;

                $lastStandard = $parts[0];
                $lastCount    = 0;

                ob_start();
            }

            echo '  '.$parts[0].'.'.$parts[2].'.'.substr($parts[3], 0, -5).PHP_EOL;
            $lastCount++;
        }//end foreach

        ob_end_clean();

    }//end explainStandard()

    /**
     * Prints out the usage information for this script.
     *
     * @return void
     */
    public function printUsage()
    {
        echo 'Usage: phpcs [-nwlsaepvi] [-d key[=value]]'.PHP_EOL;
        echo '    [--report=<report>] [--report-file=<reportfile>] [--report-<report>=<reportfile>] ...'.PHP_EOL;
        echo '    [--report-width=<reportWidth>] [--generator=<generator>] [--tab-width=<tabWidth>]'.PHP_EOL;
        echo '    [--severity=<severity>] [--error-severity=<severity>] [--warning-severity=<severity>]'.PHP_EOL;
        echo '    [--config-set key value] [--config-delete key] [--config-show]'.PHP_EOL;
        echo '    [--standard=<standard>] [--sniffs=<sniffs>] [--encoding=<encoding>]'.PHP_EOL;
        echo '    [--extensions=<extensions>] [--ignore=<patterns>] <file> ...'.PHP_EOL;
        echo '        -n            Do not print warnings (shortcut for --warning-severity=0)'.PHP_EOL;
        echo '        -w            Print both warnings and errors (on by default)'.PHP_EOL;
        echo '        -l            Local directory only, no recursion'.PHP_EOL;
        echo '        -s            Show sniff codes in all reports'.PHP_EOL;
        echo '        -a            Run interactively'.PHP_EOL;
        echo '        -e            Explain a standard by showing the sniffs it includes'.PHP_EOL;
        echo '        -p            Show progress of the run'.PHP_EOL;
        echo '        -v[v][v]      Print verbose output'.PHP_EOL;
        echo '        -i            Show a list of installed coding standards'.PHP_EOL;
        echo '        -d            Set the [key] php.ini value to [value] or [true] if value is omitted'.PHP_EOL;
        echo '        --help        Print this help message'.PHP_EOL;
        echo '        --version     Print version information'.PHP_EOL;
        echo '        <file>        One or more files and/or directories to check'.PHP_EOL;
        echo '        <extensions>  A comma separated list of file extensions to check'.PHP_EOL;
        echo '                      (only valid if checking a directory)'.PHP_EOL;
        echo '        <patterns>    A comma separated list of patterns to ignore files and directories'.PHP_EOL;
        echo '        <encoding>    The encoding of the files being checked (default is iso-8859-1)'.PHP_EOL;
        echo '        <sniffs>      A comma separated list of sniff codes to limit the check to'.PHP_EOL;
        echo '                      (all sniffs must be part of the specified standard)'.PHP_EOL;
        echo '        <severity>    The minimum severity required to display an error or warning'.PHP_EOL;
        echo '        <standard>    The name or path of the coding standard to use'.PHP_EOL;
        echo '        <tabWidth>    The number of spaces each tab represents'.PHP_EOL;
        echo '        <generator>   The name of a doc generator to use'.PHP_EOL;
        echo '                      (forces doc generation instead of checking)'.PHP_EOL;
        echo '        <report>      Print either the "full", "xml", "checkstyle", "csv", "json"'.PHP_EOL;
        echo '                      "emacs", "source", "summary", "svnblame", "gitblame", "hgblame" or'.PHP_EOL;
        echo '                      "notifysend" report'.PHP_EOL;
        echo '                      (the "full" report is printed by default)'.PHP_EOL;
        echo '        <reportfile>  Write the report to the specified file path'.PHP_EOL;
        echo '        <reportWidth> How many columns wide screen reports should be printed'.PHP_EOL;

    }//end printUsage()

    /**
     * Prints out a list of installed coding standards.
     *
     * @return void
     */
    public function printInstalledStandards()
    {
        $installedStandards = PHP_CodeSniffer::getInstalledStandards();
        $numStandards       = count($installedStandards);

        if ($numStandards === 0) {
            echo 'No coding standards are installed.'.PHP_EOL;
        } else {
            $lastStandard = array_pop($installedStandards);
            if ($numStandards === 1) {
                echo "The only coding standard installed is $lastStandard".PHP_EOL;
            } else {
                $standardList  = implode(', ', $installedStandards);
                $standardList .= ' and '.$lastStandard;
                echo 'The installed coding standards are '.$standardList.PHP_EOL;
            }
        }

    }//end printInstalledStandards()

}//end class

?>


text:
class jdk_stream_style;
class jdk_stream_style_text;
class jdk_stream_style_bin;
class jdk_stream_style_xml;
class jdk_stream;
class jdk_stream_file;
class jdk_stream_dynbuf;
class jdk_stream_socket;

class jdk_stream_style
{
  explicit jdk_stream_style( const jdk_stream_style & );
  const jdk_stream_style operator = ( const jdk_stream_style & );
 public:
    explicit jdk_stream_style() : stream() {}
	virtual ~jdk_stream_style() {}
	inline void set_stream( jdk_stream *stream_ )
		{
			stream = stream_;
		}

	virtual bool read_start_tag( const char *required_tag=0 )=0;
	virtual bool read_end_tag( const char *required_tag=0 )=0;

	virtual bool write_start_tag( const char *tag=0 )=0;
	virtual bool write_end_tag( const char *tag=0 )=0;

	virtual bool read( jdk_string &result )=0;
	virtual bool write( const jdk_string &val ) =0;
	virtual bool read( jdk_dynbuf &result )=0;
	virtual bool write( const jdk_dynbuf &val )=0;

	// now all the fundamental types
	virtual bool read( signed char &result )=0;
	virtual bool write( const signed char &val )=0;
	virtual bool read( unsigned char &result )=0;
	virtual bool write( const unsigned char &val )=0;
	virtual bool read( int16 &result )=0;
	virtual bool write( const int16 &val )=0;
	virtual bool read( uint16 &result )=0;
	virtual bool write( const uint16 &val )=0;
	virtual bool read( int32 &result )=0;
	virtual bool write( const int32 &val )=0;
	virtual bool read( uint32 &result )=0;
	virtual bool write( const uint32 &val )=0;
	virtual bool read( float &result )=0;
	virtual bool write( const float &val )=0;
	virtual bool read( double &result )=0;
	virtual bool write( const double &val )=0;
 protected:
	jdk_stream *stream;

};

class jdk_stream_style_text : public jdk_stream_style
{
 public:
	bool read_start_tag( const char *required_tag );
	bool read_end_tag( const char *required_tag);

	bool write_start_tag( const char *tag );
	bool write_end_tag( const char *tag );

	bool read( jdk_string &result );
	bool write( const jdk_string &val );
	bool read( jdk_dynbuf &result );
	bool write( const jdk_dynbuf &val );
	bool read( signed char &result );
	bool write( const signed char &val );
	bool read( unsigned char &result );
	bool write( const unsigned char &val );
	bool read( int16 &result );
	bool write( const int16 &val );
	bool read( uint16 &result );
	bool write( const uint16 &val );
	bool read( int32 &result );
	bool write( const int32 &val );
	bool read( uint32 &result );
	bool write( const uint32 &val );
	bool read( float &result );
	bool write( const float &val );
	bool read( double &result );
	bool write( const double &val );
};

class  jdk_stream_style_bin : public jdk_stream_style
{
 public:
	bool read_start_tag( const char *required_tag );
	bool read_end_tag( const char *required_tag );

	bool write_start_tag( const char *tag );
	bool write_end_tag( const char *tag );

	bool read( jdk_string &result );
	bool write( const jdk_string &val );
	bool read( jdk_dynbuf &result );
	bool write( const jdk_dynbuf &val );
	bool read( signed char &result );
	bool write( const signed char &val );
	bool read( unsigned char &result );
	bool write( const unsigned char &val );
	bool read( int16 &result );
	bool write( const int16 &val );
	bool read( uint16 &result );
	bool write( const uint16 &val );
	bool read( int32 &result );
	bool write( const int32 &val );
	bool read( uint32 &result );
	bool write( const uint32 &val );
	bool read( float &result );
	bool write( const float &val );
	bool read( double &result );
	bool write( const double &val );
};

class jdk_stream_style_xml : public jdk_stream_style
{
 public:
	bool read_start_tag( const char *required_tag );
	bool read_end_tag( const char *required_tag );

	bool write_start_tag( const char *tag );
	bool write_end_tag( const char *tag );

	bool read( jdk_string &result );
	bool write( const jdk_string &val );
	bool read( jdk_dynbuf &result );
	bool write( const jdk_dynbuf &val );
	bool read( signed char &result );
	bool write( const signed char &val );
	bool read( unsigned char &result );
	bool write( const unsigned char &val );
	bool read( int16 &result );
	bool write( const int16 &val );
	bool read( uint16 &result );
	bool write( const uint16 &val );
	bool read( int32 &result );
	bool write( const int32 &val );
	bool read( uint32 &result );
	bool write( const uint32 &val );
	bool read( float &result );
	bool write( const float &val );
	bool read( double &result );
	bool write( const double &val );
};

class jdk_stream
{
 public:
	jdk_stream() {}
	virtual ~jdk_stream() {}

	virtual void close()=0;
	virtual bool eof()=0;
	virtual bool error()=0;
	virtual bool read( jdk_string &result )=0;
	virtual bool write( const jdk_string &val ) =0;
	virtual bool read( jdk_dynbuf &buf, int len=-1 )=0;
	virtual bool write( const jdk_dynbuf &buf )=0;
	virtual bool read( void *buf, size_t sz )=0;
	virtual bool write( const void *buf, size_t sz )=0;
	virtual jdk_stream_style &style()=0;
};

inline bool jdk_stream_read( jdk_stream &stream, jdk_string &result, const char *tag )
{
	return stream.style().read_start_tag(tag) && stream.style().read(result) && stream.style().read_end_tag(tag);
}

inline bool jdk_stream_write( jdk_stream &stream, const jdk_string &val, const char *tag )
{
	return stream.style().write_start_tag(tag) && stream.style().write(val) && stream.style().write_end_tag(tag);
}

inline bool jdk_stream_read( jdk_stream &stream, jdk_dynbuf &result, const char *tag )
{
	return stream.style().read_start_tag(tag) && stream.style().read(result) && stream.style().read_end_tag(tag);
}

inline bool jdk_stream_write( jdk_stream &stream, const jdk_dynbuf &val, const char *tag )
{
	return stream.style().write_start_tag(tag) && stream.style().write(val) && stream.style().write_end_tag(tag);
}

inline bool jdk_stream_read( jdk_stream &stream, signed char &result, const char *tag )
{
	return stream.style().read_start_tag(tag) && stream.style().read(result) && stream.style().read_end_tag(tag);
}

inline bool jdk_stream_write( jdk_stream &stream, const signed char &val, const char *tag )
{
	return stream.style().write_start_tag(tag) && stream.style().write(val) && stream.style().write_end_tag(tag);
}

inline bool jdk_stream_read( jdk_stream &stream, unsigned char &result, const char *tag )
{
	return stream.style().read_start_tag(tag) && stream.style().read(result) && stream.style().read_end_tag(tag);
}

inline bool jdk_stream_write( jdk_stream &stream, const unsigned char &val, const char *tag )
{
	return stream.style().write_start_tag(tag) && stream.style().write(val) && stream.style().write_end_tag(tag);
}

inline bool jdk_stream_read( jdk_stream &stream, int16 &result, const char *tag )
{
	return stream.style().read_start_tag(tag) && stream.style().read(result) && stream.style().read_end_tag(tag);
}

inline bool jdk_stream_write( jdk_stream &stream, const int16 &val, const char *tag )
{
	return stream.style().write_start_tag(tag) && stream.style().write(val) && stream.style().write_end_tag(tag);
}

inline bool jdk_stream_read( jdk_stream &stream, uint16 &result, const char *tag )
{
	return stream.style().read_start_tag(tag) && stream.style().read(result) && stream.style().read_end_tag(tag);
}

inline bool jdk_stream_write( jdk_stream &stream, const uint16 &val, const char *tag )
{
	return stream.style().write_start_tag(tag) && stream.style().write(val) && stream.style().write_end_tag(tag);
}

inline bool jdk_stream_read( jdk_stream &stream, int32 &result, const char *tag )
{
	return stream.style().read_start_tag(tag) && stream.style().read(result) && stream.style().read_end_tag(tag);
}

inline bool jdk_stream_write( jdk_stream &stream, const int32 &val, const char *tag )
{
	return stream.style().write_start_tag(tag) && stream.style().write(val) && stream.style().write_end_tag(tag);
}

inline bool jdk_stream_read( jdk_stream &stream, uint32 &result, const char *tag )
{
	return stream.style().read_start_tag(tag) && stream.style().read(result) && stream.style().read_end_tag(tag);
}

inline bool jdk_stream_write( jdk_stream &stream, const uint32 &val, const char *tag )
{
	return stream.style().write_start_tag(tag) && stream.style().write(val) && stream.style().write_end_tag(tag);
}

inline bool jdk_stream_read( jdk_stream &stream, float &result, const char *tag )
{
	return stream.style().read_start_tag(tag) && stream.style().read(result) && stream.style().read_end_tag(tag);
}

inline bool jdk_stream_write( jdk_stream &stream, const float &val, const char *tag )
{
	return stream.style().write_start_tag(tag) && stream.style().write(val) && stream.style().write_end_tag(tag);
}

inline bool jdk_stream_read( jdk_stream &stream, double &result, const char *tag )
{
	return stream.style().read_start_tag(tag) && stream.style().read(result) && stream.style().read_end_tag(tag);
}

inline bool jdk_stream_write( jdk_stream &stream, const double &val, const char *tag )
{
	return stream.style().write_start_tag(tag) && stream.style().write(val) && stream.style().write_end_tag(tag);
}

template <class KEYTYPE,class VALUETYPE>
inline bool jdk_stream_read( jdk_stream &stream, jdk_pair<KEYTYPE,VALUETYPE> &result, const char *tag )
{
	if( !stream.style().read_start_tag(tag) )
		return false;
	if( !jdk_stream_read( stream, result.key, "key" ) )
		return false;
	if( !jdk_stream_read( stream, result.value, "value" ) )
		return false;
	if( !stream.style().read_end_tag(tag) )
		return false;
	return true;
}

template <class KEYTYPE,class VALUETYPE>
inline bool jdk_stream_write( jdk_stream &stream, const jdk_pair<KEYTYPE,VALUETYPE> &val, const char *tag )
{
	if( !stream.style().write_start_tag(tag) )
		return false;
	if( !jdk_stream_write( stream, val.key, "key" ) )
		return false;
	if( !jdk_stream_write( stream, val.value, "value" ) )
		return false;
	if( !stream.style().write_end_tag(tag) )
		return false;
	return true;
}

template <class KEYTYPE,class VALUETYPE>
inline bool jdk_stream_read( jdk_stream &stream, jdk_map<KEYTYPE,VALUETYPE> &result, const char *tag )
{
	if( !stream.style().read_start_tag(tag) )
		return false;

	int32 count=0;
	if( !jdk_stream_read( stream,  count, "count" ) )
	{
		return false;
	}
	for( int i=0; i<count; ++i )
	{
		jdk_pair<KEYTYPE,VALUETYPE> *entry = new jdk_pair<KEYTYPE,VALUETYPE>;
		if( !jdk_stream_read( stream, *entry, "item" ) )
		{
			delete entry;
			return false;
		}
		result.add( entry );
	}

	if( !stream.style().read_end_tag(tag) )
		return false;

	return true;
}

template <class KEYTYPE,class VALUETYPE>
inline bool jdk_stream_write( jdk_stream &stream, const jdk_map<KEYTYPE,VALUETYPE> &val, const char *tag )
{
	if( !stream.style().write_start_tag(tag) )
		return false;

	int32 count=0;
	int num=val.count();
	for( int i=0; i<num; ++i )
	{
		if( val.get(i) )
			++count;
	}
	if( !jdk_stream_write( stream, count, "count" ))
	{
		return false;
	}
	for( int j=0; j<num; ++j )
	{
		const jdk_pair<KEYTYPE,VALUETYPE> *entry =val.get(j);
		if( entry )
		{
			if( !jdk_stream_write( stream, *entry, "item" ) )
			{
				return false;
			}
		}
	}
	if( !stream.style().write_end_tag(tag) )
		return false;

	return true;
}

template <class T>
inline bool jdk_stream_read( jdk_stream &stream, jdk_array<T> &result, const char *tag )
{
	if( !stream.style().read_start_tag(tag) )
		return false;

	int32 count=0;
	if( !jdk_stream_read( stream,  count, "count" ) )
	{
		return false;
	}
	for( int i=0; i<count; ++i )
	{
		T *entry = new T;
		if( !jdk_stream_read( stream, *entry, "item" ) )
		{
			delete entry;
			return false;
		}
		result.add( entry );
	}
	if( !stream.style().read_end_tag(tag) )
		return false;

	return true;
}

template <class T>
inline bool jdk_stream_write( jdk_stream &stream, const jdk_array<T> &val, const char *tag )
{
	if( !stream.style().write_start_tag(tag) )
		return false;

	int32 count=0;
	int num=val.count();
	for( int i=0; i<num; ++i )
	{
		if( val.get(i) )
			++count;
	}
	if( !jdk_stream_write( stream, count, "count" ))
	{
		return false;
	}
	for( int j=0; j<num; ++j )
	{
		const T *entry =val.get(j);
		if( entry )
		{
			if( !jdk_stream_write( stream, *entry, "item" ) )
			{
				return false;
			}
		}
	}

	if( !stream.style().write_end_tag(tag) )
		return false;

	return true;
}

class jdk_stream_file : public jdk_stream
{
  explicit jdk_stream_file( const jdk_stream_file & );
  const jdk_stream_file & operator =( const jdk_stream_file & );
 public:
    explicit jdk_stream_file( jdk_stream_style *style_, const jdk_string_filename &fname, const char *openmode ) :
		f(), current_style( style_ )
		{
			current_style->set_stream( this );
			f=jdk_fopen(fname.c_str(),openmode);
		}

    explicit jdk_stream_file( jdk_stream_style *style_, FILE *f_ ) :
		f(f_), current_style( style_ )
		{
			current_style->set_stream( this );
		}

	~jdk_stream_file()
		{
			close();
			delete current_style;
		}

	void close()
		{
			fclose(f);
			f=0;
		}

	bool eof()
		{
			return feof(f)!=0;
		}

	bool error()
		{
			return ferror(f)!=0;
		}

	bool read( jdk_string &result )
		{
			return jdk_read_string_line( &result, f );
		}

	bool write( const jdk_string &val )
		{
			return jdk_write_string_line( &val, f );
		}

	bool read( jdk_dynbuf &result, int len )
		{
			return result.append_from_stream( f );
		}

	bool write( const jdk_dynbuf &val )
		{
			return val.extract_to_stream( f );
		}

	bool read( void *buf, size_t sz )
		{
			return fread(buf,sz,1,f)==1;
		}

	bool write( const void *buf, size_t sz )
		{
			return fwrite(buf,sz,1,f)==1;
		}

	jdk_stream_style &style()
		{
			return *current_style;
		}

 private:
	FILE *f;
	jdk_stream_style *current_style;
};

class jdk_stream_dynbuf : public jdk_stream
{
  explicit jdk_stream_dynbuf( const jdk_stream_dynbuf & );
  const jdk_stream_dynbuf operator = ( const jdk_stream_dynbuf & );

 public:
	jdk_stream_dynbuf( jdk_stream_style *style_, jdk_dynbuf &dynbuf_ ) :
		current_style( style_ ),
		dynbuf(dynbuf_),
		pos(0)
		{
			current_style->set_stream( this );
		}

	~jdk_stream_dynbuf()
		{
			delete current_style;
		}

	void close()
		{
			// nothing
		}

	bool eof()
		{
			return pos>=dynbuf.get_data_length();
		}

	bool error()
		{
			return false;
		}

	bool read( jdk_string &result )
		{
			size_t len = dynbuf.extract_to_string( result, pos );
			if( len>=0 )
			{
				pos+=len;
			}
			return len>=0;
		}

	bool write( const jdk_string &val )
		{
			return dynbuf.append_from_string( val );
		}

	bool read( jdk_dynbuf &result, int len )
		{
			bool r = result.append_from_buf( dynbuf, (int)pos, len );
			if( len==-1 )
				pos = dynbuf.get_data_length();
			else if( r )
				pos+=len;
			return r;
		}

	bool write( const jdk_dynbuf &val )
		{
			return dynbuf.append_from_data( val.get_data(), val.get_data_length() );
		}

	bool read( void *buf, size_t sz )
		{
			bool r = dynbuf.extract_to_data( (unsigned char *)buf, (int)pos, int(sz) );
			if( r )
				pos+=sz;
			return r;
		}

	bool write( const void *buf, size_t sz )
		{
			return dynbuf.append_from_data( (const unsigned char *)buf, int(sz) );
		}

	jdk_stream_style &style()
		{
			return *current_style;
		}

 private:
	jdk_stream_style *current_style;
	jdk_dynbuf &dynbuf;
	size_t pos;
};

class jdk_stream_socket : public jdk_stream
{
  explicit jdk_stream_socket( const jdk_stream_socket & );
  const jdk_stream_socket operator = ( const jdk_stream_socket & );
 public:
	jdk_stream_socket( jdk_stream_style *style_, jdk_client_socket &sock_ ) :
		current_style( style_ ),
		sock( sock_ )
		{
			current_style->set_stream( this );
		}

	~jdk_stream_socket()
		{
			close();
			delete current_style;
		}

	void close()
		{
			sock.close();
		}

	bool eof()
		{
			return sock.is_open_for_reading();
		}

	bool error()
		{
			return sock.is_open_for_writing() && sock.is_open_for_reading();
		}

	bool read( jdk_string &result )
		{
			return sock.read_string( result )>=0;
		}

	bool write( const jdk_string &val )
		{
			return sock.write_string_block( val )!=0;
		}

	bool read( jdk_dynbuf &result, int len )
		{
			int todo=len;
			if( todo<0 || todo>10*1024*1024 )
				return false; // have some sense!

			while( sock.is_open_for_reading() && todo>0 )
			{
				int cur = sock.read_buf( result, todo );
				if( cur<=0 )
					return false;
				todo -= cur;
			}
			return todo==0;
		}

	bool write( const jdk_dynbuf &val )
		{
			return sock.write_data_block( val )!=0;
		}

	bool read( void *buf, size_t sz )
		{
			unsigned char *p = (unsigned char *)buf;
			int todo=int(sz);
			if( todo<0 || todo>10*1024*1024 )
				return false; // have some sense!

			while( sock.is_open_for_reading() && todo>0 )
			{
				int cur = sock.read_data( p, todo );
				if( cur<=0 )
					return false;
				todo -= cur;
				p+=cur;
			}
			return todo==0;
		}

	bool write( const void *buf, size_t sz )
		{
			return (size_t)sock.write_data_block( buf, (unsigned long)sz )==sz;
		}

	jdk_stream_style &style()
		{
			return *current_style;
		}
 private:
	jdk_stream_style *current_style;
	jdk_client_socket &sock;
};

#endif


text:
package org.apache.camel.dataformat.zipfile;

import java.util.Iterator;

import org.apache.camel.AggregationStrategy;
import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.junit.Test;

public class ZipFileMultipleFilesSplitterTest extends ZipSplitterRouteTest {
    static final String PROCESSED_FILES_HEADER_NAME = "processedFiles";

    @Test
    public void testSplitter() throws InterruptedException {
        MockEndpoint processZipEntry = getMockEndpoint("mock:processZipEntry");
        MockEndpoint splitResult = getMockEndpoint("mock:splitResult");
        processZipEntry.expectedBodiesReceivedInAnyOrder("chau", "hi", "hola", "another_chiau", "another_hi");
        splitResult.expectedBodiesReceivedInAnyOrder("chiau.txt", "hi.txt", "hola.txt", "directoryOne/another_chiau.txt", "directoryOne/another_hi.txt");
        assertMockEndpointsSatisfied();
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                // Unzip file and Split it according to FileEntry
                ZipFileDataFormat zipFile = new ZipFileDataFormat();
                zipFile.setUsingIterator(true);
                from("file:src/test/resources/org/apache/camel/dataformat/zipfile/data/?consumer.delay=1000&noop=true")
                        .unmarshal(zipFile)
                        .split(bodyAs(Iterator.class))
                        .streaming()
                        .aggregationStrategy(updateHeader())
                        .convertBodyTo(String.class)
                        .to("mock:processZipEntry")
                        .end()
                        .log("Done processing big file: ${header.CamelFileName}")
                        .setBody().header(PROCESSED_FILES_HEADER_NAME)
                        .split().body()
                        .to("mock:splitResult");
            }
        };

    }

    private AggregationStrategy updateHeader() {
        return new AggregationStrategy() {
            @Override
            public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
                if (oldExchange != null) {
                    String processedFiles = oldExchange.getIn().getHeader(PROCESSED_FILES_HEADER_NAME, String.class);
                    if (processedFiles == null) {
                        processedFiles = oldExchange.getIn().getHeader("zipFileName", String.class);
                    }
                    processedFiles = processedFiles + "," + newExchange.getIn().getHeader("zipFileName", String.class);
                    newExchange.getIn().setHeader(PROCESSED_FILES_HEADER_NAME, processedFiles);
                }
                return newExchange;
            }

        };
    }

}


text:
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Diagnostics.Contracts;
using System;

// Disable the "this variable is not used" warning as every field would imply it.
#pragma warning disable 0414
// Disable the "this variable is never assigned to".
#pragma warning disable 0067
// Disable the "this event is never assigned to".
#pragma warning disable 0649
// Disable the "this variable is never used".
#pragma warning disable 0169
// Disable the "new keyword not required" warning.
#pragma warning disable 0109
// Disable the "extern without DllImport" warning.
#pragma warning disable 0626
// Disable the "could hide other member" warning, can happen on certain properties.
#pragma warning disable 0108

namespace System.Windows.Automation.Peers
{
  public partial class ScrollBarAutomationPeer : RangeBaseAutomationPeer
  {
    #region Methods and constructors
    protected override AutomationControlType GetAutomationControlTypeCore()
    {
      return default(AutomationControlType);
    }

    protected override string GetClassNameCore()
    {
      return default(string);
    }

    protected override System.Windows.Point GetClickablePointCore()
    {
      return default(System.Windows.Point);
    }

    protected override AutomationOrientation GetOrientationCore()
    {
      return default(AutomationOrientation);
    }

    public ScrollBarAutomationPeer(System.Windows.Controls.Primitives.ScrollBar owner) : base (default(System.Windows.Controls.Primitives.RangeBase))
    {
    }
    #endregion
  }
}