text:
package com.example.zjy.niklauslibrary.rvhelper.wrapper;

import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.view.View;
import android.view.ViewGroup;

import com.example.zjy.niklauslibrary.rvhelper.base.ViewHolder;
import com.example.zjy.niklauslibrary.rvhelper.utils.WrapperUtils;

/**
 * Created by zhy on 16/6/23.
 */
public class LoadMoreWrapper<T> extends RecyclerView.Adapter<RecyclerView.ViewHolder>
{
    public static final int ITEM_TYPE_LOAD_MORE = Integer.MAX_VALUE - 2;

    private RecyclerView.Adapter mInnerAdapter;
    private View mLoadMoreView;
    private int mLoadMoreLayoutId;

    public LoadMoreWrapper(RecyclerView.Adapter adapter)
    {
        mInnerAdapter = adapter;
    }

    private boolean hasLoadMore()
    {
        return mLoadMoreView != null || mLoadMoreLayoutId != 0;
    }

    private boolean isShowLoadMore(int position)
    {
        return hasLoadMore() && (position >= mInnerAdapter.getItemCount());
    }

    @Override
    public int getItemViewType(int position)
    {
        if (isShowLoadMore(position))
        {
            return ITEM_TYPE_LOAD_MORE;
        }
        return mInnerAdapter.getItemViewType(position);
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType)
    {
        if (viewType == ITEM_TYPE_LOAD_MORE)
        {
            ViewHolder holder;
            if (mLoadMoreView != null)
            {
                holder = ViewHolder.createViewHolder(parent.getContext(), mLoadMoreView);
            } else
            {
                holder = ViewHolder.createViewHolder(parent.getContext(), parent, mLoadMoreLayoutId);
            }
            return holder;
        }
        return mInnerAdapter.onCreateViewHolder(parent, viewType);
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position)
    {
        if (isShowLoadMore(position))
        {
            if (mOnLoadMoreListener != null)
            {
                mOnLoadMoreListener.onLoadMoreRequested();
            }
            return;
        }
        mInnerAdapter.onBindViewHolder(holder, position);
    }

    @Override
    public void onAttachedToRecyclerView(RecyclerView recyclerView)
    {
        WrapperUtils.onAttachedToRecyclerView(mInnerAdapter, recyclerView, new WrapperUtils.SpanSizeCallback()
        {
            @Override
            public int getSpanSize(GridLayoutManager layoutManager, GridLayoutManager.SpanSizeLookup oldLookup, int position)
            {
                if (isShowLoadMore(position))
                {
                    return layoutManager.getSpanCount();
                }
                if (oldLookup != null)
                {
                    return oldLookup.getSpanSize(position);
                }
                return 1;
            }
        });
    }

    @Override
    public void onViewAttachedToWindow(RecyclerView.ViewHolder holder)
    {
        mInnerAdapter.onViewAttachedToWindow(holder);

        if (isShowLoadMore(holder.getLayoutPosition()))
        {
            setFullSpan(holder);
        }
    }

    private void setFullSpan(RecyclerView.ViewHolder holder)
    {
        ViewGroup.LayoutParams lp = holder.itemView.getLayoutParams();

        if (lp != null
                && lp instanceof StaggeredGridLayoutManager.LayoutParams)
        {
            StaggeredGridLayoutManager.LayoutParams p = (StaggeredGridLayoutManager.LayoutParams) lp;

            p.setFullSpan(true);
        }
    }

    @Override
    public int getItemCount()
    {
        return mInnerAdapter.getItemCount() + (hasLoadMore() ? 1 : 0);
    }

    public interface OnLoadMoreListener
    {
        void onLoadMoreRequested();
    }

    private OnLoadMoreListener mOnLoadMoreListener;

    public LoadMoreWrapper setOnLoadMoreListener(OnLoadMoreListener loadMoreListener)
    {
        if (loadMoreListener != null)
        {
            mOnLoadMoreListener = loadMoreListener;
        }
        return this;
    }

    public LoadMoreWrapper setLoadMoreView(View loadMoreView)
    {
        mLoadMoreView = loadMoreView;
        return this;
    }

    public LoadMoreWrapper setLoadMoreView(int layoutId)
    {
        mLoadMoreLayoutId = layoutId;
        return this;
    }
}


text:
//[-------------------------------------------------------]
//[ Includes                                              ]
//[-------------------------------------------------------]
#include "Examples/Private/Basics/Instancing/Instancing.h"
#include "Examples/Private/Framework/Color4.h"

// Disable warnings in external headers, we can't fix them
PRAGMA_WARNING_PUSH
	PRAGMA_WARNING_DISABLE_MSVC(4127)	// warning C4127: conditional expression is constant
	PRAGMA_WARNING_DISABLE_MSVC(4201)	// warning C4201: nonstandard extension used: nameless struct/union
	PRAGMA_WARNING_DISABLE_MSVC(4464)	// warning C4464: relative include path contains '..'
	PRAGMA_WARNING_DISABLE_MSVC(4324)	// warning C4324: '<x>': structure was padded due to alignment specifier
	PRAGMA_WARNING_DISABLE_MSVC(4668)	// warning C4668: '_M_HYBRID_X86_ARM64' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
	PRAGMA_WARNING_DISABLE_MSVC(5214)	// warning C5214: applying '*=' to an operand with a volatile qualified type is deprecated in C++20 (compiling source file E:\private\unrimp\Source\RendererToolkit\Private\AssetCompiler\TextureAssetCompiler.cpp)
	#include <glm/glm.hpp>
PRAGMA_WARNING_POP

//[-------------------------------------------------------]
//[ Public virtual IApplication methods                   ]
//[-------------------------------------------------------]
void Instancing::onInitialization()
{
	// Get and check the RHI instance
	Rhi::IRhiPtr rhi(getRhi());
	if (nullptr != rhi)
	{
		// Create the buffer manager
		mBufferManager = rhi->createBufferManager();

		{ // Create the root signature
			// Setup
			Rhi::RootSignatureBuilder rootSignatureBuilder;
			rootSignatureBuilder.initialize(0, nullptr, 0, nullptr, Rhi::RootSignatureFlags::ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT);

			// Create the instance
			mRootSignature = rhi->createRootSignature(rootSignatureBuilder);
		}

		{
			// There are two instancing approaches available
			// - Instanced arrays (shader model 3 feature, vertex array element advancing per-instance instead of per-vertex)
			// - Draw instanced (shader model 4 feature, build in shader variable holding the current instance ID)
			//
			// In general, instanced arrays will probably run on the most systems:
			// -> Direct3D 10, Direct3D 11 and Direct3D 12 support both approaches
			// -> Direct3D 9 has support for instanced arrays, but does not support draw instanced
			// -> OpenGL 3.1 introduced draw instance ("GL_ARB_draw_instanced"-extension)
			// -> OpenGL 3.3 introduced instance array ("GL_ARB_instanced_arrays"-extension)
			// -> OpenGL ES 3.0 support both approaches
			Rhi::IShaderLanguage& shaderLanguage = rhi->getDefaultShaderLanguage();

			// Left side (green): Instanced arrays (shader model 3 feature, vertex array element advancing per-instance instead of per-vertex)
			if (rhi->getCapabilities().instancedArrays)
			{
				// Vertex input layout
				static constexpr Rhi::VertexAttribute vertexAttributesLayout[] =
				{
					{ // Attribute 0
						// Data destination
						Rhi::VertexAttributeFormat::FLOAT_2,	// vertexAttributeFormat (Rhi::VertexAttributeFormat)
						"Position",								// name[32] (char)
						"POSITION",								// semanticName[32] (char)
						0,										// semanticIndex (uint32_t)
						// Data source
						0,										// inputSlot (uint32_t)
						0,										// alignedByteOffset (uint32_t)
						sizeof(float) * 2,						// strideInBytes (uint32_t)
						0										// instancesPerElement (uint32_t)
					},
					{ // Attribute 1
						// Data destination
						Rhi::VertexAttributeFormat::FLOAT_1,	// vertexAttributeFormat (Rhi::VertexAttributeFormat)
						"InstanceID",							// name[32] (char)
						"TEXCOORD",								// semanticName[32] (char)
						0,										// semanticIndex (uint32_t)
						// Data source
						1,										// inputSlot (uint32_t)
						0,										// alignedByteOffset (uint32_t)
						sizeof(float),							// strideInBytes (uint32_t)
						1										// instancesPerElement (uint32_t)
					}
				};
				const Rhi::VertexAttributes vertexAttributes(static_cast<uint32_t>(GLM_COUNTOF(vertexAttributesLayout)), vertexAttributesLayout);

				{ // Create vertex array object (VAO)
					// Create the vertex buffer object (VBO)
					// -> Clip space vertex positions, left/bottom is (-1,-1) and right/top is (1,1)
					static constexpr float VERTEX_POSITION[] =
					{					// Vertex ID	Triangle on screen
						 0.0f, 1.0f,	// 0					 .0
						 0.0f, 0.0f,	// 1				 .    .
						-1.0f, 0.0f		// 2			  2.......1
					};
					Rhi::IVertexBufferPtr vertexBufferPosition(mBufferManager->createVertexBuffer(sizeof(VERTEX_POSITION), VERTEX_POSITION));

					// Create the per-instance-data vertex buffer object (VBO)
					// -> Simple instance ID in order to keep it similar to the "draw instanced" version on the right side (blue)
					static constexpr float INSTANCE_ID[] =
					{
						0.0f, 1.0f
					};
					Rhi::IVertexBufferPtr vertexBufferInstanceId(mBufferManager->createVertexBuffer(sizeof(INSTANCE_ID), INSTANCE_ID));

					// Create the index buffer object (IBO)
					// -> In this example, we only draw a simple triangle and therefore usually do not need an index buffer
					// -> In Direct3D 9, instanced arrays with hardware support is only possible when drawing indexed primitives, see
					//    "Efficiently Drawing Multiple Instances of Geometry (Direct3D 9)"-article at MSDN: http://msdn.microsoft.com/en-us/library/windows/desktop/bb173349%28v=vs.85%29.aspx#Drawing_Non_Indexed_Geometry
					static constexpr uint16_t INDICES[] =
					{
						0, 1, 2
					};
					Rhi::IIndexBufferPtr indexBufferInstancedArrays(mBufferManager->createIndexBuffer(sizeof(INDICES), INDICES));

					// Create vertex array object (VAO)
					// -> The vertex array object (VAO) keeps a reference to the used vertex buffer object (VBO)
					// -> This means that there's no need to keep an own vertex buffer object (VBO) reference
					// -> When the vertex array object (VAO) is destroyed, it automatically decreases the
					//    reference of the used vertex buffer objects (VBO). If the reference counter of a
					//    vertex buffer object (VBO) reaches zero, it's automatically destroyed.
					const Rhi::VertexArrayVertexBuffer vertexArrayVertexBuffers[] = { { vertexBufferPosition }, { vertexBufferInstanceId } };
					mVertexArrayInstancedArrays = mBufferManager->createVertexArray(vertexAttributes, static_cast<uint32_t>(GLM_COUNTOF(vertexArrayVertexBuffers)), vertexArrayVertexBuffers, indexBufferInstancedArrays);
				}

				// Create the graphics program
				Rhi::IGraphicsProgramPtr graphicsProgram;
				{
					// Get the shader source code (outsourced to keep an overview)
					const char* vertexShaderSourceCode = nullptr;
					const char* fragmentShaderSourceCode = nullptr;
					#include "Instancing_InstancedArrays_GLSL_450.h"	// For Vulkan
					#include "Instancing_InstancedArrays_GLSL_410.h"	// macOS 10.11 only supports OpenGL 4.1 hence it's our OpenGL minimum
					#include "Instancing_InstancedArrays_GLSL_ES3.h"
					#include "Instancing_InstancedArrays_HLSL_D3D9_D3D10_D3D11_D3D12.h"
					#include "Instancing_InstancedArrays_Null.h"

					// Create the graphics program
					graphicsProgram = shaderLanguage.createGraphicsProgram(
						*mRootSignature,
						vertexAttributes,
						shaderLanguage.createVertexShaderFromSourceCode(vertexAttributes, vertexShaderSourceCode),
						shaderLanguage.createFragmentShaderFromSourceCode(fragmentShaderSourceCode));
				}

				// Create the graphics pipeline state object (PSO)
				if (nullptr != graphicsProgram)
				{
					mGraphicsPipelineStateInstancedArrays = rhi->createGraphicsPipelineState(Rhi::GraphicsPipelineStateBuilder(mRootSignature, graphicsProgram, vertexAttributes, getMainRenderTarget()->getRenderPass()));
				}
			}

			// Right side (blue): Draw instanced (shader model 4 feature, build in shader variable holding the current instance ID)
			if (rhi->getCapabilities().drawInstanced)
			{
				// Vertex input layout
				static constexpr Rhi::VertexAttribute vertexAttributesLayout[] =
				{
					{ // Attribute 0
						// Data destination
						Rhi::VertexAttributeFormat::FLOAT_2,	// vertexAttributeFormat (Rhi::VertexAttributeFormat)
						"Position",								// name[32] (char)
						"POSITION",								// semanticName[32] (char)
						0,										// semanticIndex (uint32_t)
						// Data source
						0,										// inputSlot (uint32_t)
						0,										// alignedByteOffset (uint32_t)
						sizeof(float) * 2,						// strideInBytes (uint32_t)
						0										// instancesPerElement (uint32_t)
					}
				};
				const Rhi::VertexAttributes vertexAttributes(static_cast<uint32_t>(GLM_COUNTOF(vertexAttributesLayout)), vertexAttributesLayout);

				{ // Create vertex array object (VAO)
					// Create the vertex buffer object (VBO)
					// -> Clip space vertex positions, left/bottom is (-1,-1) and right/top is (1,1)
					static constexpr float VERTEX_POSITION[] =
					{				// Vertex ID	Triangle on screen
						0.0f, 1.0f,	// 0			  0.
						1.0f, 0.0f,	// 1			  .    .
						0.0f, 0.0f	// 2			  2.......1
					};
					Rhi::IVertexBufferPtr vertexBuffer(mBufferManager->createVertexBuffer(sizeof(VERTEX_POSITION), VERTEX_POSITION));

					// Create vertex array object (VAO)
					// -> The vertex array object (VAO) keeps a reference to the used vertex buffer object (VBO)
					// -> This means that there's no need to keep an own vertex buffer object (VBO) reference
					// -> When the vertex array object (VAO) is destroyed, it automatically decreases the
					//    reference of the used vertex buffer objects (VBO). If the reference counter of a
					//    vertex buffer object (VBO) reaches zero, it's automatically destroyed.
					const Rhi::VertexArrayVertexBuffer vertexArrayVertexBuffers[] = { { vertexBuffer } };
					mVertexArrayDrawInstanced = mBufferManager->createVertexArray(vertexAttributes, static_cast<uint32_t>(GLM_COUNTOF(vertexArrayVertexBuffers)), vertexArrayVertexBuffers);
				}

				// Create the graphics program
				Rhi::IGraphicsProgramPtr graphicsProgram;
				{
					// Get the shader source code (outsourced to keep an overview)
					const char* vertexShaderSourceCode = nullptr;
					const char* fragmentShaderSourceCode = nullptr;
					#include "Instancing_DrawInstanced_GLSL_450.h"	// For Vulkan
					#include "Instancing_DrawInstanced_GLSL_410.h"	// macOS 10.11 only supports OpenGL 4.1 hence it's our OpenGL minimum
					#include "Instancing_DrawInstanced_GLSL_ES3.h"
					#include "Instancing_DrawInstanced_HLSL_D3D10_D3D11_D3D12.h"
					#include "Instancing_DrawInstanced_Null.h"

					// Create the graphics program
					graphicsProgram = shaderLanguage.createGraphicsProgram(
						*mRootSignature,
						vertexAttributes,
						shaderLanguage.createVertexShaderFromSourceCode(vertexAttributes, vertexShaderSourceCode),
						shaderLanguage.createFragmentShaderFromSourceCode(fragmentShaderSourceCode));
				}

				// Create the graphics pipeline state object (PSO)
				if (nullptr != graphicsProgram)
				{
					mGraphicsPipelineStateDrawInstanced = rhi->createGraphicsPipelineState(Rhi::GraphicsPipelineStateBuilder(mRootSignature, graphicsProgram, vertexAttributes, getMainRenderTarget()->getRenderPass()));
				}
			}
		}

		// Since we're always dispatching the same commands to the RHI, we can fill the command buffer once during initialization and then reuse it multiple times during runtime
		fillCommandBuffer();
	}
}

void Instancing::onDeinitialization()
{
	// Release the used resources
	mVertexArrayDrawInstanced = nullptr;
	mGraphicsPipelineStateDrawInstanced = nullptr;
	mVertexArrayInstancedArrays = nullptr;
	mGraphicsPipelineStateInstancedArrays = nullptr;
	mRootSignature = nullptr;
	mCommandBuffer.clear();
	mBufferManager = nullptr;
}

void Instancing::onDraw(Rhi::CommandBuffer& commandBuffer)
{
	// Dispatch pre-recorded command buffer
	Rhi::Command::DispatchCommandBuffer::create(commandBuffer, &mCommandBuffer);
}

//[-------------------------------------------------------]
//[ Private methods                                       ]
//[-------------------------------------------------------]
void Instancing::fillCommandBuffer()
{
	// Sanity checks
	ASSERT(nullptr != getRhi(), "Invalid RHI instance")
	RHI_ASSERT(getRhi()->getContext(), mCommandBuffer.isEmpty(), "The command buffer is already filled")
	RHI_ASSERT(getRhi()->getContext(), nullptr != mRootSignature, "Invalid root signature")
	RHI_ASSERT(getRhi()->getContext(), nullptr != mGraphicsPipelineStateInstancedArrays, "Invalid graphics pipeline state instanced arrays")
	RHI_ASSERT(getRhi()->getContext(), nullptr != mVertexArrayInstancedArrays, "Invalid vertex array instanced arrays")
	RHI_ASSERT(getRhi()->getContext(), !getRhi()->getCapabilities().drawInstanced || nullptr != mGraphicsPipelineStateDrawInstanced, "Invalid graphics pipeline state draw instanced")
	RHI_ASSERT(getRhi()->getContext(), !getRhi()->getCapabilities().drawInstanced || nullptr != mVertexArrayDrawInstanced, "Invalid vertex array draw instanced")

	// Scoped debug event
	COMMAND_SCOPED_DEBUG_EVENT_FUNCTION(mCommandBuffer)

	// Clear the graphics color buffer of the current render target with gray, do also clear the depth buffer
	Rhi::Command::ClearGraphics::create(mCommandBuffer, Rhi::ClearFlag::COLOR_DEPTH, Color4::GRAY);

	// Set the used graphics root signature
	Rhi::Command::SetGraphicsRootSignature::create(mCommandBuffer, mRootSignature);

	// Left side (green): Instanced arrays (shader model 3 feature, vertex array element advancing per-instance instead of per-vertex)
	if (getRhi()->getCapabilities().instancedArrays)
	{
		// Scoped debug event
		COMMAND_SCOPED_DEBUG_EVENT(mCommandBuffer, "Draw using instanced arrays")

		// Set the used graphics pipeline state object (PSO)
		Rhi::Command::SetGraphicsPipelineState::create(mCommandBuffer, mGraphicsPipelineStateInstancedArrays);

		// Input assembly (IA): Set the used vertex array
		Rhi::Command::SetGraphicsVertexArray::create(mCommandBuffer, mVertexArrayInstancedArrays);

		// Render the specified geometric primitive, based on an array of vertices
		// -> In this example, we only draw a simple triangle and therefore usually do not need an index buffer
		// -> In Direct3D 9, instanced arrays with hardware support is only possible when drawing indexed primitives, see
		//    "Efficiently Drawing Multiple Instances of Geometry (Direct3D 9)"-article at MSDN: http://msdn.microsoft.com/en-us/library/windows/desktop/bb173349%28v=vs.85%29.aspx#Drawing_Non_Indexed_Geometry
		Rhi::Command::DrawIndexedGraphics::create(mCommandBuffer, 3, 2);
	}

	// Right side (blue): Draw instanced (shader model 4 feature, build in shader variable holding the current instance ID)
	if (getRhi()->getCapabilities().drawInstanced)
	{
		// Scoped debug event
		COMMAND_SCOPED_DEBUG_EVENT(mCommandBuffer, "Draw instanced")

		// Set the used graphics pipeline state object (PSO)
		Rhi::Command::SetGraphicsPipelineState::create(mCommandBuffer, mGraphicsPipelineStateDrawInstanced);

		// Input assembly (IA): Set the used vertex array
		Rhi::Command::SetGraphicsVertexArray::create(mCommandBuffer, mVertexArrayDrawInstanced);

		// Render the specified geometric primitive, based on an array of vertices
		Rhi::Command::DrawGraphics::create(mCommandBuffer, 3, 2);
	}
}

redpajama_set_name: RedPajamaGithub


text:
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/bootloader/bl_pnor_utils.C $                              */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2015,2016                        */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */

#include <bootloader/bootloader.H>

#define bl_pnor_utils_C

#include <stdio.h>
#include <endian.h>

int strcmp(const char *str1, const char *str2)
{
    for(uint32_t strcmp_index = 0;
        strcmp_index < 12;
        strcmp_index++)
    {
        if((str1[strcmp_index] == '\0') && (str2[strcmp_index] == '\0'))
        {
            return 0;
        }
        else if(str1[strcmp_index] ==  str2[strcmp_index])
        {
            continue;
        }
        else
        {
            return 1;
        }
    }
    return 0;
}

#include <pnor_utils.C>

#undef bl_pnor_utils_C


text:
import moment from "moment";

const getCurrentYear = () => moment().year();
const getCurrentMonth = () => moment().month() + 1;
export { getCurrentYear, getCurrentMonth };


text:
<?php

namespace pixelmelody\phpwebtoken\formats;

/**
 * Formato CSV - Comma Separated Values.
 *
 * TODO Work in progess
 *
 * Parser de conteúdo de um token em formato <i>CSV</>. Alguns são os casos em
 * que este formato pode ser utilizado, sendo que este permite eliminar a
 * utilização de formatos mais elaborados que contemplam vários níveis de
 * conteúdo e delimitadores mais elaborados.
 *
 * Não se trata de um formato CSV puro pois tem em conta que os campos são
 * separados por 'virgulas' mas no entanto estes contemplam o nome do campo e
 * o seu conteúdo separados por um sinal de igual. ex: campo1=test,campo2=test2
 *
 * Se a implementação do token não requer um conteúdo muito elaborado então este
 * será o formato que permite reduções de tamanho.
 *
 * @author PixelMelody <lab@pixelmelody.com>
 * @copyright 2015 Pixelmelody PT Portugal
 */
class CSVFormat extends \pixelmelody\phpwebtoken\contracts\FormatAbstract {

    /**
     * Construtor
     *
     * @param type $content
     */
    function __construct($content) {

        $buffer = [];
        if (is_string($content) || is_object($content)) {
            $buffer = explode(',', (string) $content);
        } elseif (is_array($content)) {
            $buffer = $content;
        }

        parent::__construct($buffer);
    }

    public function getType() {
        return "CWT";
    }

    /**
     * Retorna o conteúdo codificado em formato CSV
     * @return string
     */
    public function toString() {

        $buffer = "";
        if ($this->count() > 0) {
            foreach ($this->toArray() as $k => $v) {
                $buffer .= "{$k}={$v},";
            }
        }
        return strlen($buffer) > 0 ? substr($buffer, 0, -1) : "";
    }

}


text:
#import <Foundation/Foundation.h>

#import <FBControlCore/FBControlCore.h>

#import <FBDeviceControl/FBAFCConnection.h>

NS_ASSUME_NONNULL_BEGIN

/**
 An implementation of FBFileContainer, backed by an FBAFCConnection
 */
@interface FBDeviceFileContainer : NSObject <FBFileContainer>

/**
 The Designated Initializer.

 @param connection the connection to use.
 @param queue the queue to perform work on.
 @return a new FBDeviceFileCommands instance.
 */
- (instancetype)initWithAFCConnection:(FBAFCConnection *)connection queue:(dispatch_queue_t)queue;

@end

/**
 An implementation of FBFileCommands for Devices
 */
@interface FBDeviceFileCommands : NSObject <FBFileCommands, FBiOSTargetCommand>

#pragma mark Initializers

/**
 The Designated Initializer.

 @param target the target to use.
 @param afcCalls the calls to use.
 @return a new FBDeviceApplicationDataCommands instance.
 */
+ (instancetype)commandsWithTarget:(id<FBiOSTarget>)target afcCalls:(AFCCalls)afcCalls;

@end

NS_ASSUME_NONNULL_END


text:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://interpretatie.kern.schemas.dov.vlaanderen.be" targetNamespace="http://interpretatie.kern.schemas.dov.vlaanderen.be" elementFormDefault="unqualified" attributeFormDefault="unqualified" version="1.00">
	<xs:simpleType name="GeotechnischeCoderingHoofdnaamCodesEnumType">
		<xs:annotation>
			<xs:documentation>de mogelijke waarden voor de hoofdnaam van de geotechnische codering (codes)</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:enumeration value="AA">
				<xs:annotation>
					<xs:documentation>amfiboliet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="AB">
				<xs:annotation>
					<xs:documentation>andesiet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="AC">
				<xs:annotation>
					<xs:documentation>anhydriet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="AD">
				<xs:annotation>
					<xs:documentation>ankeriet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="AE">
				<xs:annotation>
					<xs:documentation>arkose</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="AF">
				<xs:annotation>
					<xs:documentation>afval</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="AG">
				<xs:annotation>
					<xs:documentation>as</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="AN">
				<xs:annotation>
					<xs:documentation>ant. n. vloeistofd.</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="AR">
				<xs:annotation>
					<xs:documentation>areniet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="AT">
				<xs:annotation>
					<xs:documentation>asfalt</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="AV">
				<xs:annotation>
					<xs:documentation>ant. vloeistofdicht</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="AW">
				<xs:annotation>
					<xs:documentation>ant. w. vloeistofd.</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="BA">
				<xs:annotation>
					<xs:documentation>basalt</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="BB">
				<xs:annotation>
					<xs:documentation>bauxiet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="BC">
				<xs:annotation>
					<xs:documentation>bentoniet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="BK">
				<xs:annotation>
					<xs:documentation>baksteen</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="BS">
				<xs:annotation>
					<xs:documentation>blauwshist</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="CA">
				<xs:annotation>
					<xs:documentation>carbonaatfragmenten</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="CB">
				<xs:annotation>
					<xs:documentation>conglomeraat/breccie</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="CO">
				<xs:annotation>
					<xs:documentation>steenkool</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="CT">
				<xs:annotation>
					<xs:documentation>chert (gebande)</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="DA">
				<xs:annotation>
					<xs:documentation>daciet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="DB">
				<xs:annotation>
					<xs:documentation>diatomiet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="DC">
				<xs:annotation>
					<xs:documentation>dioriet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="DD">
				<xs:annotation>
					<xs:documentation>dolerriet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="DE">
				<xs:annotation>
					<xs:documentation>duniet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="DK">
				<xs:annotation>
					<xs:documentation>dolom kalksteen</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="DL">
				<xs:annotation>
					<xs:documentation>dolomiet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="EA">
				<xs:annotation>
					<xs:documentation>evaporiet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="EC">
				<xs:annotation>
					<xs:documentation>eclogiet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FA">
				<xs:annotation>
					<xs:documentation>fosforiet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FE">
				<xs:annotation>
					<xs:documentation>ijzer</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FG">
				<xs:annotation>
					<xs:documentation>fijn grind</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FO">
				<xs:annotation>
					<xs:documentation>fossielen</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FY">
				<xs:annotation>
					<xs:documentation>fylliet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="FZ">
				<xs:annotation>
					<xs:documentation>fijn zand</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="GA">
				<xs:annotation>
					<xs:documentation>geroerd / gestoord</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="GB">
				<xs:annotation>
					<xs:documentation>gabbro</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="GC">
				<xs:annotation>
					<xs:documentation>gips</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="GD">
				<xs:annotation>
					<xs:documentation>gneiss</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="GE">
				<xs:annotation>
					<xs:documentation>graniet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="GF">
				<xs:annotation>
					<xs:documentation>granodioriet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="GG">
				<xs:annotation>
					<xs:documentation>grof grind</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="GH">
				<xs:annotation>
					<xs:documentation>groenshist</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="GI">
				<xs:annotation>
					<xs:documentation>glimmers</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="GL">
				<xs:annotation>
					<xs:documentation>glauconiet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="GM">
				<xs:annotation>
					<xs:documentation>gespleten metamorf</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="GS">
				<xs:annotation>
					<xs:documentation>groensteen</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="GZ">
				<xs:annotation>
					<xs:documentation>grof zand</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="HA">
				<xs:annotation>
					<xs:documentation>haliet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="HB">
				<xs:annotation>
					<xs:documentation>hematiet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="HC">
				<xs:annotation>
					<xs:documentation>houtskool</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="HD">
				<xs:annotation>
					<xs:documentation>hornfels</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="HT">
				<xs:annotation>
					<xs:documentation>houtresten</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="HU">
				<xs:annotation>
					<xs:documentation>humus</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="IA">
				<xs:annotation>
					<xs:documentation>ijzerooliet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="IN">
				<xs:annotation>
					<xs:documentation>intrusief gesteente</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="KA">
				<xs:annotation>
					<xs:documentation>kalk</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="KB">
				<xs:annotation>
					<xs:documentation>kalksteenbreccie</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="KC">
				<xs:annotation>
					<xs:documentation>kalkschiefer</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="KL">
				<xs:annotation>
					<xs:documentation>klei</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="KO">
				<xs:annotation>
					<xs:documentation>komatiet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="KR">
				<xs:annotation>
					<xs:documentation>krijt</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="KS">
				<xs:annotation>
					<xs:documentation>kalksteen</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="KT">
				<xs:annotation>
					<xs:documentation>kleisteen</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="KW">
				<xs:annotation>
					<xs:documentation>kwartsiet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="LA">
				<xs:annotation>
					<xs:documentation>lateriet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="LE">
				<xs:annotation>
					<xs:documentation>leem</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="LG">
				<xs:annotation>
					<xs:documentation>ligniet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="LI">
				<xs:annotation>
					<xs:documentation>limoniet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="LS">
				<xs:annotation>
					<xs:documentation>leisteen</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="MA">
				<xs:annotation>
					<xs:documentation>marmer</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="MB">
				<xs:annotation>
					<xs:documentation>micashist</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="ME">
				<xs:annotation>
					<xs:documentation>mergel</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="MG">
				<xs:annotation>
					<xs:documentation>middelmatig grind</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="MI">
				<xs:annotation>
					<xs:documentation>migmatiet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="MM">
				<xs:annotation>
					<xs:documentation>metamorf gesteente</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="MS">
				<xs:annotation>
					<xs:documentation>schiefer</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="MY">
				<xs:annotation>
					<xs:documentation>myloniet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="MZ">
				<xs:annotation>
					<xs:documentation>middelmatig zand</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="NN">
				<xs:annotation>
					<xs:documentation>nummulieten</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="OK">
				<xs:annotation>
					<xs:documentation>oölitische kalksteen</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="OM">
				<xs:annotation>
					<xs:documentation>organisch materiaal</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="PA">
				<xs:annotation>
					<xs:documentation>pegmatiet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="PB">
				<xs:annotation>
					<xs:documentation>peridodiet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="PC">
				<xs:annotation>
					<xs:documentation>poederkool</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="PD">
				<xs:annotation>
					<xs:documentation>pyroxeniet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="PL">
				<xs:annotation>
					<xs:documentation>plantenresten</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="PM">
				<xs:annotation>
					<xs:documentation>puimsteen</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="PS">
				<xs:annotation>
					<xs:documentation>psammiet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="PU">
				<xs:annotation>
					<xs:documentation>puin</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="PY">
				<xs:annotation>
					<xs:documentation>pyriet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="QU">
				<xs:annotation>
					<xs:documentation>kwarts</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="RA">
				<xs:annotation>
					<xs:documentation>radiolariet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="RB">
				<xs:annotation>
					<xs:documentation>rhyoliet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="RO">
				<xs:annotation>
					<xs:documentation>rots</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="RV">
				<xs:annotation>
					<xs:documentation>verweerde rots</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="SA">
				<xs:annotation>
					<xs:documentation>sideriet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="SC">
				<xs:annotation>
					<xs:documentation>schelpen</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="SE">
				<xs:annotation>
					<xs:documentation>sedimentair</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="SF">
				<xs:annotation>
					<xs:documentation>schelpfragmenten</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="SG">
				<xs:annotation>
					<xs:documentation>schelpgruis</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="SH">
				<xs:annotation>
					<xs:documentation>schalie</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="SI">
				<xs:annotation>
					<xs:documentation>silt</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="SK">
				<xs:annotation>
					<xs:documentation>schieferige kalkst.</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="SL">
				<xs:annotation>
					<xs:documentation>slib</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="SN">
				<xs:annotation>
					<xs:documentation>steenfragmenten</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="SO">
				<xs:annotation>
					<xs:documentation>scoria</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="SP">
				<xs:annotation>
					<xs:documentation>serpentiniet</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="SS">
				<xs:annotation>
					<xs:documentation>siltsteen</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="ST">
				<xs:annotation>
					<xs:documentation>stenen</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="SX">
				<xs:annotation>
					<xs:documentation>silex</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="SY">
				<xs:annotation>
					<xs:documentation>shist</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="TA">
				<xs:annotation>
					<xs:documentation>teelaarde</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="TB">
				<xs:annotation>
					<xs:documentation>tuff</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="TS">
				<xs:annotation>
					<xs:documentation>tufsteen (tuffeau)</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="VA">
				<xs:annotation>
					<xs:documentation>vulkanisch gesteente</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="VE">
				<xs:annotation>
					<xs:documentation>veen</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="VS">
				<xs:annotation>
					<xs:documentation>vuursteen</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="WA">
				<xs:annotation>
					<xs:documentation>wacksteen</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="XG">
				<xs:annotation>
					<xs:documentation>grind</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="XX">
				<xs:annotation>
					<xs:documentation>onbekend</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="XZ">
				<xs:annotation>
					<xs:documentation>zand</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="ZE">
				<xs:annotation>
					<xs:documentation>zeepsteen</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="ZK">
				<xs:annotation>
					<xs:documentation>kalkzandsteen</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="ZL">
				<xs:annotation>
					<xs:documentation>zandleem</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="ZS">
				<xs:annotation>
					<xs:documentation>zandsteen</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="GeotechnischeCoderingBijmengingHoeveelheidEnumType">
		<xs:annotation>
			<xs:documentation>de mogelijke waarden voor de bijmenging van de geotechnische codering (codes)</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:enumeration value="Z">
				<xs:annotation>
					<xs:documentation>weinig Xhoudend</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="M">
				<xs:annotation>
					<xs:documentation>Xhoudend</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="S">
				<xs:annotation>
					<xs:documentation>sterk Xhoudend</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="W">
				<xs:annotation>
					<xs:documentation>weinig X</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="V">
				<xs:annotation>
					<xs:documentation>veel X</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="N">
				<xs:annotation>
					<xs:documentation>geen aanduiding van de hoeveelheid</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="GeotechnischeCoderingKleurEnumType">
		<xs:annotation>
			<xs:documentation>lijst van kleuren van een boring</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:enumeration value="onbekend"/>
			<xs:enumeration value="beige"/>
			<xs:enumeration value="zwart"/>
			<xs:enumeration value="lichtbeige"/>
			<xs:enumeration value="lichtblauw"/>
			<xs:enumeration value="lichtbruin"/>
			<xs:enumeration value="lichtgeel"/>
			<xs:enumeration value="lichtgrijs"/>
			<xs:enumeration value="lichtgroen"/>
			<xs:enumeration value="lichtroest"/>
			<xs:enumeration value="lichtrood"/>
			<xs:enumeration value="beigebruin"/>
			<xs:enumeration value="blauwgrijs"/>
			<xs:enumeration value="lichtmauve"/>
			<xs:enumeration value="blauwgroen"/>
			<xs:enumeration value="lichtkaki"/>
			<xs:enumeration value="lichtroos"/>
			<xs:enumeration value="lichtoker"/>
			<xs:enumeration value="lichtolijfgroen"/>
			<xs:enumeration value="lichtoranje"/>
			<xs:enumeration value="bruingeel"/>
			<xs:enumeration value="bruingrijs"/>
			<xs:enumeration value="bruingroen"/>
			<xs:enumeration value="bruinrood"/>
			<xs:enumeration value="geelgrijs"/>
			<xs:enumeration value="geelgroen"/>
			<xs:enumeration value="blauw"/>
			<xs:enumeration value="grijsgroen"/>
			<xs:enumeration value="donkerbeige"/>
			<xs:enumeration value="donkerblauw"/>
			<xs:enumeration value="donkerbruin"/>
			<xs:enumeration value="donkergeel"/>
			<xs:enumeration value="donkergroen"/>
			<xs:enumeration value="donkerroest"/>
			<xs:enumeration value="donkerrood"/>
			<xs:enumeration value="grijsroest"/>
			<xs:enumeration value="bontgekleurd"/>
			<xs:enumeration value="donkermauve"/>
			<xs:enumeration value="mauve"/>
			<xs:enumeration value="donkerkaki"/>
			<xs:enumeration value="donkerroos"/>
			<xs:enumeration value="donkeroker"/>
			<xs:enumeration value="donkerolijfgroen"/>
			<xs:enumeration value="donkeroranje"/>
			<xs:enumeration value="geelbruin"/>
			<xs:enumeration value="grijsgeel"/>
			<xs:enumeration value="onbepaald"/>
			<xs:enumeration value="donkergrijs"/>
			<xs:enumeration value="bleek / ontkleurd"/>
			<xs:enumeration value="roodbruin"/>
			<xs:enumeration value="bruin"/>
			<xs:enumeration value="kaki"/>
			<xs:enumeration value="blauwgeel"/>
			<xs:enumeration value="blauwkaki"/>
			<xs:enumeration value="blauwmauve"/>
			<xs:enumeration value="blauwoker"/>
			<xs:enumeration value="blauwolijfgroen"/>
			<xs:enumeration value="blauworanje"/>
			<xs:enumeration value="blauwroest"/>
			<xs:enumeration value="blauwrood"/>
			<xs:enumeration value="blauwroos"/>
			<xs:enumeration value="roos"/>
			<xs:enumeration value="bruinblauw"/>
			<xs:enumeration value="bruinbeige"/>
			<xs:enumeration value="bruinkaki"/>
			<xs:enumeration value="bruinmauve"/>
			<xs:enumeration value="bruinoker"/>
			<xs:enumeration value="bruinolijfgroen"/>
			<xs:enumeration value="bruinoranje"/>
			<xs:enumeration value="bruinroest"/>
			<xs:enumeration value="bruinroos"/>
			<xs:enumeration value="mauvebeige"/>
			<xs:enumeration value="oker"/>
			<xs:enumeration value="mauveblauw"/>
			<xs:enumeration value="mauvebruin"/>
			<xs:enumeration value="mauvegeel"/>
			<xs:enumeration value="mauvegrijs"/>
			<xs:enumeration value="mauvegroen"/>
			<xs:enumeration value="mauvekaki"/>
			<xs:enumeration value="mauveoker"/>
			<xs:enumeration value="mauveolijfgroen"/>
			<xs:enumeration value="mauveoranje"/>
			<xs:enumeration value="mauveroest"/>
			<xs:enumeration value="olijfgroen"/>
			<xs:enumeration value="mauverood"/>
			<xs:enumeration value="mauveroos"/>
			<xs:enumeration value="okerbeige"/>
			<xs:enumeration value="okerblauw"/>
			<xs:enumeration value="okerbruin"/>
			<xs:enumeration value="okergeel"/>
			<xs:enumeration value="okergrijs"/>
			<xs:enumeration value="okergroen"/>
			<xs:enumeration value="okerkaki"/>
			<xs:enumeration value="okermauve"/>
			<xs:enumeration value="oranje"/>
			<xs:enumeration value="okerolijfgroen"/>
			<xs:enumeration value="okeroranje"/>
			<xs:enumeration value="okerroest"/>
			<xs:enumeration value="okerrood"/>
			<xs:enumeration value="okerroos"/>
			<xs:enumeration value="olijfgroenbeige"/>
			<xs:enumeration value="olijfgroenblauw"/>
			<xs:enumeration value="olijfgroenbruin"/>
			<xs:enumeration value="olijfgroengeel"/>
			<xs:enumeration value="olijfgroengrijs"/>
			<xs:enumeration value="olijfgroengroen"/>
			<xs:enumeration value="olijfgroenkaki"/>
			<xs:enumeration value="olijfgroenmauve"/>
			<xs:enumeration value="olijfgroenoker"/>
			<xs:enumeration value="olijfgroenoranje"/>
			<xs:enumeration value="olijfgroenroest"/>
			<xs:enumeration value="olijfgroenrood"/>
			<xs:enumeration value="olijfgroenroos"/>
			<xs:enumeration value="oranjebeige"/>
			<xs:enumeration value="oranjeblauw"/>
			<xs:enumeration value="oranjebruin"/>
			<xs:enumeration value="oranjegeel"/>
			<xs:enumeration value="oranjegrijs"/>
			<xs:enumeration value="oranjegroen"/>
			<xs:enumeration value="oranjekaki"/>
			<xs:enumeration value="oranjemauve"/>
			<xs:enumeration value="oranjeoker"/>
			<xs:enumeration value="oranjeolijfgroen"/>
			<xs:enumeration value="oranjeoranje"/>
			<xs:enumeration value="oranjeroest"/>
			<xs:enumeration value="oranjerood"/>
			<xs:enumeration value="oranjeroos"/>
			<xs:enumeration value="roestbeige"/>
			<xs:enumeration value="roestblauw"/>
			<xs:enumeration value="roestbruin"/>
			<xs:enumeration value="roestgeel"/>
			<xs:enumeration value="roestgrijs"/>
			<xs:enumeration value="roestgroen"/>
			<xs:enumeration value="roestkaki"/>
			<xs:enumeration value="roestmauve"/>
			<xs:enumeration value="roestoker"/>
			<xs:enumeration value="roestolijfgroen"/>
			<xs:enumeration value="roestoranje"/>
			<xs:enumeration value="roestroest"/>
			<xs:enumeration value="roestrood"/>
			<xs:enumeration value="roestroos"/>
			<xs:enumeration value="roodbeige"/>
			<xs:enumeration value="roodblauw"/>
			<xs:enumeration value="roodgeel"/>
			<xs:enumeration value="roodgrijs"/>
			<xs:enumeration value="roodgroen"/>
			<xs:enumeration value="roodkaki"/>
			<xs:enumeration value="roodmauve"/>
			<xs:enumeration value="roodoker"/>
			<xs:enumeration value="roodolijfgroen"/>
			<xs:enumeration value="roodoranje"/>
			<xs:enumeration value="roodroest"/>
			<xs:enumeration value="roodroos"/>
			<xs:enumeration value="geel"/>
			<xs:enumeration value="geelroos"/>
			<xs:enumeration value="roosbeige"/>
			<xs:enumeration value="roosblauw"/>
			<xs:enumeration value="roosbruin"/>
			<xs:enumeration value="roosgeel"/>
			<xs:enumeration value="roosgrijs"/>
			<xs:enumeration value="roosgroen"/>
			<xs:enumeration value="rooskaki"/>
			<xs:enumeration value="roosmauve"/>
			<xs:enumeration value="roosoker"/>
			<xs:enumeration value="roosolijfgroen"/>
			<xs:enumeration value="geelbeige"/>
			<xs:enumeration value="roosoranje"/>
			<xs:enumeration value="roosroest"/>
			<xs:enumeration value="roosrood"/>
			<xs:enumeration value="beigewit"/>
			<xs:enumeration value="blauwwit"/>
			<xs:enumeration value="bruinwit"/>
			<xs:enumeration value="geelwit"/>
			<xs:enumeration value="grijswit"/>
			<xs:enumeration value="groenwit"/>
			<xs:enumeration value="kakiwit"/>
			<xs:enumeration value="geelblauw"/>
			<xs:enumeration value="mauvewit"/>
			<xs:enumeration value="okerwit"/>
			<xs:enumeration value="olijfgroenwit"/>
			<xs:enumeration value="oranjewit"/>
			<xs:enumeration value="roestwit"/>
			<xs:enumeration value="roodwit"/>
			<xs:enumeration value="rooswit"/>
			<xs:enumeration value="beigezwart"/>
			<xs:enumeration value="blauwzwart"/>
			<xs:enumeration value="bruinzwart"/>
			<xs:enumeration value="geelkaki"/>
			<xs:enumeration value="geelzwart"/>
			<xs:enumeration value="grijszwart"/>
			<xs:enumeration value="groenzwart"/>
			<xs:enumeration value="kakizwart"/>
			<xs:enumeration value="mauvezwart"/>
			<xs:enumeration value="okerzwart"/>
			<xs:enumeration value="olijfgroenzwart"/>
			<xs:enumeration value="roestzwart"/>
			<xs:enumeration value="roodzwart"/>
			<xs:enumeration value="rooszwart"/>
			<xs:enumeration value="geelmauve"/>
			<xs:enumeration value="lichtzwart"/>
			<xs:enumeration value="lichtwit"/>
			<xs:enumeration value="donkerzwart"/>
			<xs:enumeration value="donkerwit"/>
			<xs:enumeration value="witbeige"/>
			<xs:enumeration value="witblauw"/>
			<xs:enumeration value="witbruin"/>
			<xs:enumeration value="witgeel"/>
			<xs:enumeration value="witgrijs"/>
			<xs:enumeration value="witgroen"/>
			<xs:enumeration value="geeloker"/>
			<xs:enumeration value="witkaki"/>
			<xs:enumeration value="witmauve"/>
			<xs:enumeration value="witoker"/>
			<xs:enumeration value="witolijfgroen"/>
			<xs:enumeration value="witoranje"/>
			<xs:enumeration value="witroest"/>
			<xs:enumeration value="witrood"/>
			<xs:enumeration value="witroos"/>
			<xs:enumeration value="zwartbeige"/>
			<xs:enumeration value="zwartblauw"/>
			<xs:enumeration value="geelolijfgroen"/>
			<xs:enumeration value="zwartbruin"/>
			<xs:enumeration value="zwartgeel"/>
			<xs:enumeration value="zwartgrijs"/>
			<xs:enumeration value="zwartgroen"/>
			<xs:enumeration value="zwartkaki"/>
			<xs:enumeration value="zwartmauve"/>
			<xs:enumeration value="zwartoker"/>
			<xs:enumeration value="zwartolijfgroen"/>
			<xs:enumeration value="zwartoranje"/>
			<xs:enumeration value="zwartroest"/>
			<xs:enumeration value="geeloranje"/>
			<xs:enumeration value="zwartrood"/>
			<xs:enumeration value="zwartroos"/>
			<xs:enumeration value="paarsbruin"/>
			<xs:enumeration value="lichtrood / roos"/>
			<xs:enumeration value="zwartwit"/>
			<xs:enumeration value="geelroest"/>
			<xs:enumeration value="geelrood"/>
			<xs:enumeration value="grijs"/>
			<xs:enumeration value="grijsbeige"/>
			<xs:enumeration value="grijsblauw"/>
			<xs:enumeration value="grijsbruin"/>
			<xs:enumeration value="grijskaki"/>
			<xs:enumeration value="grijsmauve"/>
			<xs:enumeration value="grijsoker"/>
			<xs:enumeration value="grijsolijfgroen"/>
			<xs:enumeration value="grijsoranje"/>
			<xs:enumeration value="grijsrood"/>
			<xs:enumeration value="grijsroos"/>
			<xs:enumeration value="groen"/>
			<xs:enumeration value="groenbeige"/>
			<xs:enumeration value="groenblauw"/>
			<xs:enumeration value="groenbruin"/>
			<xs:enumeration value="groengeel"/>
			<xs:enumeration value="groengrijs"/>
			<xs:enumeration value="groenkaki"/>
			<xs:enumeration value="groenmauve"/>
			<xs:enumeration value="groenoker"/>
			<xs:enumeration value="groenolijfgroen"/>
			<xs:enumeration value="groenoranje"/>
			<xs:enumeration value="roest"/>
			<xs:enumeration value="groenroest"/>
			<xs:enumeration value="groenrood"/>
			<xs:enumeration value="groenroos"/>
			<xs:enumeration value="kakibeige"/>
			<xs:enumeration value="kakiblauw"/>
			<xs:enumeration value="kakibruin"/>
			<xs:enumeration value="kakigeel"/>
			<xs:enumeration value="kakigrijs"/>
			<xs:enumeration value="kakigroen"/>
			<xs:enumeration value="kakimauve"/>
			<xs:enumeration value="rood"/>
			<xs:enumeration value="kakioker"/>
			<xs:enumeration value="kakiolijfgroen"/>
			<xs:enumeration value="kakioranje"/>
			<xs:enumeration value="kakiroest"/>
			<xs:enumeration value="kakirood"/>
			<xs:enumeration value="kakiroos"/>
			<xs:enumeration value="beigeblauw"/>
			<xs:enumeration value="beigegeel"/>
			<xs:enumeration value="beigegrijs"/>
			<xs:enumeration value="beigegroen"/>
			<xs:enumeration value="wit"/>
			<xs:enumeration value="beigekaki"/>
			<xs:enumeration value="beigemauve"/>
			<xs:enumeration value="beigeoker"/>
			<xs:enumeration value="beigeolijfgroen"/>
			<xs:enumeration value="beigeoranje"/>
			<xs:enumeration value="beigeroest"/>
			<xs:enumeration value="beigerood"/>
			<xs:enumeration value="beigeroos"/>
			<xs:enumeration value="blauwbeige"/>
			<xs:enumeration value="blauwbruin"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>


text:
<?php
namespace Aws\KinesisVideoArchivedMedia\Exception;

use Aws\Exception\AwsException;

/**
 * Represents an error interacting with the **Amazon Kinesis Video Streams Archived Media** service.
 */
class KinesisVideoArchivedMediaException extends AwsException {}


text:
/*eslint-env mocha*/
import chai, {assert} from 'chai';
import sinon from 'sinon';
//import jsdom from 'jsdom';
import frontexpress from '../lib/frontexpress';
import Requester from '../lib/requester';

describe('Application', () => {
    class MyMiddleware extends frontexpress.Middleware {
        entered() {}
        exited() {}
        failed() {}
        updated() {}
    }

    let requester;

    describe('generated methods', () => {
        it('checks http methods are exposed', ()=> {
            const app = frontexpress();
            assert(typeof app.httpGet === 'function');
            assert(typeof app.httpPut === 'function');
            assert(typeof app.httpPost === 'function');
            assert(typeof app.httpDelete === 'function');
        });

        it('checks middleware methods are exposed', ()=> {
            const app = frontexpress();
            assert(typeof app.get === 'function');
            assert(typeof app.put === 'function');
            assert(typeof app.post === 'function');
            assert(typeof app.delete === 'function');
        });
    });

    // // JSDOM cannot manage pushState/onpopstate/window.location
    // see https://github.com/tmpvar/jsdom/issues/1565
    //
    // describe('listen method with JSDOM', () => {
    //     before(() => {
    //         // Init DOM with a fake document
    //         // <base> and uri (initial uri) allow to do pushState in jsdom
    //         jsdom.env({
    //             html:`
    //                 <html>
    //                     <head>
    //                         <base href="http://localhost:8080/"></base>
    //                     </head>
    //                 </html>
    //             `,
    //             url: 'http://localhost:8080/',
    //             done(err, window) {
    //                 global.window = window;
    //                 global.document = window.document;
    //                 window.console = global.console;
    //             }
    //         });
    //     });

    //     let requester;
    //     beforeEach(()=>{
    //         requester = new Requester();
    //         sinon.stub(requester, 'fetch', ({uri, method, headers, data}, resolve, reject) => {
    //             resolve(
    //                 {uri, method, headers, data},
    //                 {status: 200, statusText: 'OK', responseText:''}
    //             );
    //         });
    //     });

    //     it('history management without state object', (done) => {
    //         const spy_pushState = sinon.spy(window.history, 'pushState');

    //         const app = frontexpress();
    //         const m = new MyMiddleware();
    //         const spy_middleware = sinon.stub(m, 'updated');

    //         app.set('http requester', requester);
    //         app.use('/api/route1', m);
    //         app.listen();

    //         const spy_onpopstate = sinon.spy(window, 'onpopstate');

    //         app.httpGet({uri:'/api/route1', history: {
    //             uri: '/route1',
    //             title: 'route1'
    //         }},
    //         (req, res) => {
    //             // On request succeeded
    //             assert(spy_onpopstate.callCount === 0);
    //             assert(spy_pushState.calledOnce);
    //             assert(spy_middleware.calledOnce);

    //             spy_middleware.reset();
    //             window.history.back();
    //             window.history.forward();
    //             assert(spy_onpopstate.calledOnce);
    //             assert(spy_middleware.calledOnce);

    //             done();
    //         });
    //     });
    // });

    describe('listen method', () => {
        // Here I cannot use jsdon to make these tests :(
        // JSDOM cannot simulate readyState changes
        beforeEach(() => {
            const browserHistory = [{uri: '/'}];
            let browserHistoryIndex = 0;

            global.document = {};
            global.window = {
                location: {
                    pathname: '/route1',
                    search: '?a=b'
                },
                history: {
                    pushState(state, title, pathname) {
                        browserHistory.push({uri: pathname, state});
                        browserHistoryIndex++;
                        global.window.location.pathname = browserHistory[browserHistoryIndex].uri;
                    },
                    forward() {
                        browserHistoryIndex++;
                        global.window.location.pathname = browserHistory[browserHistoryIndex].uri;
                        if (browserHistory[browserHistoryIndex].state) {
                            window.onpopstate({state:browserHistory[browserHistoryIndex].state});
                        }
                    },
                    back() {
                        browserHistoryIndex--;
                        global.window.location.pathname = browserHistory[browserHistoryIndex].uri;
                        if (browserHistory[browserHistoryIndex].state) {
                            window.onpopstate({state: browserHistory[browserHistoryIndex].state});
                        }
                    }
                }
            };
        });

        it('with function middleware readyState===interactive', (done) => {
            const app = frontexpress();
            app.use('/route1', (request, response, next) => {
                done();
            });
            app.listen();

            //simulate readystatechange
            document.readyState = 'interactive';
            document.onreadystatechange();
        });

        it('with middleware object readyState===loading', (done) => {
            const app = frontexpress();
            const m = new MyMiddleware();
            sinon.stub(m, 'entered', () => {
                done();
            });

            app.use('/route1', m);
            app.listen();

            //simulate readystatechange
            document.readyState = 'loading';
            document.onreadystatechange();
        });

        it('with middleware object readyState===interactive', (done) => {
            const app = frontexpress();
            const m = new MyMiddleware();
            sinon.stub(m, 'updated', () => {
                done();
            });

            app.use('/route1', m);
            app.listen();

            //simulate readystatechange
            document.readyState = 'interactive';
            document.onreadystatechange();
        });

        it('with middleware object event beforeunload', (done) => {
            const app = frontexpress();
            const m = new MyMiddleware();
            sinon.stub(m, 'exited', () => {
                done();
            });

            app.use('/route1', m);
            app.listen(() => {
                //simulate beforeunload
                window.onbeforeunload();
            });

            //simulate readystatechange
            document.readyState = 'interactive';
            document.onreadystatechange();
        });

        it('history management without state object', (done) => {
            let historyObj;
            const requester = new Requester();
            sinon.stub(requester, 'fetch', ({uri, method, headers, data, history}, resolve, reject) => {
                resolve(
                    {uri, method, headers, data, history},
                    {status: 200, statusText: 'OK', responseText:''}
                );
            });

            const spy_pushState = sinon.spy(window.history, 'pushState');

            const app = frontexpress();
            const m = new MyMiddleware();
            const spy_middleware = sinon.stub(m, 'updated', (req, res) => {
                historyObj = req.history;
            });

            app.set('http requester', requester);
            app.use('/api/route1', m);
            app.listen();

            const spy_onpopstate = sinon.spy(window, 'onpopstate');

            app.httpGet({uri:'/api/route1', history: {
                uri: '/route1',
                title: 'route1'
            }},
            (req, res) => {
                // On request succeeded
                assert(spy_onpopstate.callCount === 0);
                assert(spy_pushState.calledOnce);
                assert(spy_middleware.calledOnce);

                spy_middleware.reset();
                window.history.back();
                window.history.forward();
                assert(spy_onpopstate.calledOnce);
                assert(spy_middleware.calledOnce);
                assert(historyObj);
                assert(historyObj.uri === '/route1');
                assert(historyObj.title === 'route1');

                done();
            });
        });

        it('history management with state object', (done) => {
            let historyObj;
            const requester = new Requester();
            sinon.stub(requester, 'fetch', ({uri, method, headers, data, history}, resolve, reject) => {
                resolve(
                    {uri, method, headers, data, history},
                    {status: 200, statusText: 'OK', responseText:''}
                );
            });

            const spy_pushState = sinon.spy(window.history, 'pushState');

            const app = frontexpress();
            const m = new MyMiddleware();
            const spy_middleware = sinon.stub(m, 'updated', (req, res) => {
                historyObj = req.history;
            });

            app.set('http requester', requester);
            app.use('/api/route1', m);
            app.listen();

            const spy_onpopstate = sinon.spy(window, 'onpopstate');

            app.httpGet({uri:'/api/route1', history: {
                uri: '/route1',
                title: 'route1',
                state: {a: 'b', c: 'd'}
            }},
            (req, res) => {
                // On request succeeded
                assert(spy_onpopstate.callCount === 0);
                assert(spy_pushState.calledOnce);
                assert(spy_middleware.calledOnce);

                spy_middleware.reset();
                window.history.back();
                window.history.forward();
                assert(spy_onpopstate.calledOnce);
                assert(spy_middleware.calledOnce);
                assert(historyObj);
                assert(historyObj.uri === '/route1');
                assert(historyObj.title === 'route1');
                assert(historyObj.state);
                assert(historyObj.state.a === 'b');
                assert(historyObj.state.c === 'd');

                done();
            });
        });
    });

    describe('set/get setting method', () => {
        it('custom setting', () => {
            const app = frontexpress();
            app.set('blabla', 'value');
            assert(app.get('blabla') === 'value');
        });

        it('core setting', () => {
            const requester = new Requester();
            const app = frontexpress();
            app.set('http requester', requester);
            assert(app.get('http requester') === requester);
            assert(app.set('http requester') === requester);
        });

        it('bad core setting', () => {
            const app = frontexpress();
            chai.expect(() => (app.set('http requester', 'not an object with fetch function'))).to.throw(TypeError);
        });
    });

    describe('use method', () => {
        beforeEach(()=>{
            requester = new Requester();
            sinon.stub(requester, 'fetch', ({uri, method, headers, data}, resolve, reject) => {
                resolve(
                    {uri, method, headers, data},
                    {status: 200, statusText: 'OK', responseText:''}
                );
            });
        });

        it('no arguments', () => {
            const app = frontexpress();
            app.set('http requester', requester);
            assert.throws(app.use, TypeError);
        });

        it('bad arguments', () => {
            const app = frontexpress();
            app.set('http requester', requester);
            chai.expect(() => app.use('eee')).to.throw(TypeError);
        });

        it('mixing uri and regexp', () => {
            let router = frontexpress.Router('/subroute');
            let app = frontexpress();
            app.set('http requester', requester);
            chai.expect(() => app.use(/route/, router)).to.throw(TypeError);

            router = frontexpress.Router(/subroute/);
            app = frontexpress();
            app.set('http requester', requester);
            chai.expect(() => app.use('/route', router)).to.throw(TypeError);
        });

        it('middleware as function on path /', (done) => {
            const spy = sinon.spy();

            const app = frontexpress();
            app.set('http requester', requester);
            app.use((request, response, next) => {spy();});

            app.httpGet('/', (request, response) => {
                assert(spy.callCount === 1);

                app.httpPost('/route1', (request, response) => {
                    assert(spy.callCount === 2);
                    done();
                });
            });
        });

        it('middleware as function on path /route1', (done) => {
            const spy = sinon.spy();

            const app = frontexpress();
            app.set('http requester', requester);
            app.use('/route1', (request, response, next) => {spy();});

            app.httpGet('/route1', (request, response) => {
                assert(spy.callCount === 1);

                app.httpPost('/route1', (request, response) => {
                    assert(spy.callCount === 2);
                    done();
                });
            });
        });

        it('middleware as function on path / request fails', (done) => {
            requester = new Requester();
            sinon.stub(requester, 'fetch', ({uri, method, headers, data}, resolve, reject) => {
                reject(
                    {uri, method, headers, data},
                    {status: 401, statusText: 'not logged'}
                );
            });

            const spy = sinon.spy();

            const app = frontexpress();
            app.set('http requester', requester);
            app.use((request, response, next) => {spy();});

            app.httpGet('/', null, (request, response) => {
                assert(spy.callCount === 1);
                assert(response.status === 401);
                done();
            });
        });

        it('middleware as object on path /', (done) => {
            const middleware = new MyMiddleware('on path /');
            const spy = sinon.spy(middleware, 'updated');

            const app = frontexpress();
            app.set('http requester', requester);
            app.use(middleware);

            app.httpGet('/', (request, response) => {
                assert(spy.callCount === 1);

                app.httpPost('/route1', (request, response) => {
                    assert(spy.callCount === 2);
                    done();
                });
            });
        });

        it('middleware as object on path /route1', (done) => {
            const middleware = new MyMiddleware('on path /route1');
            const spy = sinon.spy(middleware, 'updated');

            const app = frontexpress();
            app.set('http requester', requester);
            app.use('/route1', middleware);

            app.httpGet('/route1', (request, response) => {
                assert(spy.callCount === 1);

                app.httpPost('/route1', (request, response) => {
                    assert(spy.callCount === 2);
                    done();
                });
            });
        });

        it('middleware as object on path / request fails', (done) => {
            requester = new Requester();
            sinon.stub(requester, 'fetch', ({uri, method, headers, data}, resolve, reject) => {
                reject(
                    {uri, method, headers, data},
                    {status: 401, statusText: 'not logged'}
                );
            });

            const middleware = new MyMiddleware('on path /');
            const spy = sinon.spy(middleware, 'failed');

            const app = frontexpress();
            app.set('http requester', requester);
            app.use(middleware);

            app.httpGet('/', null, (request, response) => {
                assert(spy.callCount === 1);
                assert(response.status === 401);
                done();
            });
        });

        it('router on path /', (done) => {
            const spy = sinon.spy();
            const router = frontexpress.Router();
            router
                .get((request, response, next) => {spy();})
                .post((request, response, next) => {spy();});

            const app = frontexpress();
            app.set('http requester', requester);
            app.use(router);

            app.httpGet('/', (request, response) => {
                assert(spy.callCount === 1);

                app.httpPost('/route1', (request, response) => {
                    assert(spy.callCount === 2);
                    done();
                });
            });
        });

        it('router on path /route1', (done) => {
            const spy = sinon.spy();
            const router = frontexpress.Router();
            router
                .get((request, response, next) => {spy();})
                .post((request, response, next) => {spy();});

            const app = frontexpress();
            app.set('http requester', requester);
            app.use('/route1', router);

            app.httpGet('/route1', (request, response) => {
                assert(spy.callCount === 1);

                app.httpPost('/route1', (request, response) => {
                    assert(spy.callCount === 2);
                    done();
                });
            });
        });

        it('router with base uri', (done)=> {
            const middleware = new MyMiddleware('get middleware');
            const spy = sinon.spy(middleware, 'updated');

            const app = frontexpress();
            app.set('http requester', requester);

            const router = frontexpress.Router();
            router.get('/subroute1', middleware);

            app.use('/route1', router);

            app.httpGet('/route1/subroute1', (request, response) => {
                assert(spy.calledOnce);
                done();
            },
            (request, response) => {
                done(response);
            });
        });

        it('use two routers', (done)=> {

            const router1 = frontexpress.Router();
            const m1 = new MyMiddleware();
            const spy1 = sinon.spy(m1, 'updated');
            router1.get('/subroute1', m1);

            const router2 = frontexpress.Router();
            const m2 = new MyMiddleware();
            const spy2 = sinon.spy(m2, 'updated');
            router2.get('/subroute2', m2);

            assert(router1 !== router2);

            const app = frontexpress();
            app.set('http requester', requester);
            app.use(/^\/route1/, router1);
            app.use(/^\/route2/, router2);

            app.httpGet('/route1/subroute1',
                (request, response) => {
                    assert(spy1.calledOnce);
                    app.httpGet('/route2/subroute2', (request, response) => {
                        assert(spy2.calledOnce);
                        done();
                    },
                    (request, response) => {
                        done(response);
                    });
                },
                (request, response) => {
                    done(response);
                });
        });
    });

    describe('get method', () => {
        beforeEach(()=>{
            requester = new Requester();
            sinon.stub(requester, 'fetch', ({uri, method, headers, data}, resolve, reject) => {
                resolve(
                    {uri, method, headers, data},
                    {status: 200, statusText: 'OK', responseText:''}
                );
            });
        });

        it('no arguments', () => {
            const app = frontexpress();
            app.set('http requester', requester);
            assert.throws(app.get, TypeError);
        });

        it('bad arguments', () => {
            const app = frontexpress();
            app.set('http requester', requester);
            chai.expect(() => app.get(frontexpress.Router())).to.throw(TypeError);
            chai.expect(() => app.get('/route1', frontexpress.Router())).to.throw(TypeError);
        });

        it('middleware as function on path /', (done) => {
            const spy = sinon.spy();

            const app = frontexpress();
            app.set('http requester', requester);
            app.get((request, respons, next) => {spy();});

            app.httpGet('/', (request, response) => {
                assert(spy.callCount === 1);

                app.httpPost('/route1', (request, response) => {
                    assert(spy.callCount === 1);
                    done();
                });
            });
        });

        it('middleware as function on path /route1', (done) => {
            const spy = sinon.spy();

            const app = frontexpress();
            app.set('http requester', requester);
            app.get('/route1', (request, response, next) => {spy();});

            app.httpGet('/route1', (request, response) => {
                assert(spy.callCount === 1);

                app.httpPost('/route1', (request, response) => {
                    assert(spy.callCount === 1);
                    done();
                });
            });
        });

        it('middleware as object on path /', (done) => {
            const middleware = new MyMiddleware('on path /');
            const spy = sinon.spy(middleware, 'updated');

            const app = frontexpress();
            app.set('http requester', requester);
            app.get(middleware);

            app.httpGet('/', (request, response) => {
                assert(spy.callCount === 1);

                app.httpPost('/route1', (request, response) => {
                    assert(spy.callCount === 1);
                    done();
                });
            });
        });

        it('middleware as object on path /route1', (done) => {
            const middleware = new MyMiddleware('on path /route1');
            const spy = sinon.spy(middleware, 'updated');

            const app = frontexpress();
            app.set('http requester', requester);
            app.get(middleware);

            app.httpGet('/route1', (request, response) => {
                assert(spy.callCount === 1);

                app.httpPost('/route1', (request, response) => {
                    assert(spy.callCount === 1);
                    done();
                });
            });
        });
    });

    describe('post method', () => {
        beforeEach(()=>{
            requester = new Requester();
            sinon.stub(requester, 'fetch', ({uri, method, headers, data}, resolve, reject) => {
                resolve(
                    {uri, method, headers, data},
                    {status: 200, statusText: 'OK', responseText:''}
                );
            });
        });

        it('no arguments', () => {
            const app = frontexpress();
            app.set('http requester', requester);
            assert.throws(app.post, TypeError);
        });
    });

    describe('route method', () => {
        beforeEach(()=>{
            requester = new Requester();
            sinon.stub(requester, 'fetch', ({uri, method, headers, data}, resolve, reject) => {
                resolve(
                    {uri, method, headers, data},
                    {status: 200, statusText: 'OK', responseText:''}
                );
            });
        });

        it('on root path not specified', (done) => {
            const spy = sinon.spy();

            const app = frontexpress();
            app.set('http requester', requester);
            app.route().get((request, response, next) => {spy();});

            app.httpGet('/', (request, response) => {
                assert(spy.calledOnce);
                app.httpPost('/', (request, response) => {
                    assert(spy.calledOnce);
                    done();
                });
            });

        });

        it('on root path /', (done) => {
            const spy = sinon.spy();

            const app = frontexpress();
            app.set('http requester', requester);
            app.route('/').get((request, response, next) => {spy();});

            app.httpGet('/', (request, response) => {
                assert(spy.calledOnce);
                app.httpPost('/', (request, response) => {
                    assert(spy.calledOnce);
                    done();
                });
            });

        });

        it('on root path /route1', (done) => {
            const spy = sinon.spy();

            const app = frontexpress();
            app.set('http requester', requester);
            app.route('/route1').get((request, response, next) => {spy();});

            app.httpGet('/route1', (request, response) => {
                assert(spy.calledOnce);
                app.httpPost('/route1', (request, response) => {
                    assert(spy.calledOnce);
                    done();
                });
            });

        });

        it('on root path undefined with sub path /subroute1', (done) => {
            const spy = sinon.spy();

            const app = frontexpress();
            app.set('http requester', requester);
            app.route().get('/subroute1', (request, response, next) => {spy();});

            app.httpGet('/subroute1', (request, response) => {
                assert(spy.calledOnce);
                app.httpPost('/subroute1', (request, response) => {
                    assert(spy.calledOnce);
                    done();
                });
            });
        });

        it('on root path / with sub path /subroute1', (done) => {
            const spy = sinon.spy();

            const app = frontexpress();
            app.set('http requester', requester);
            app.route('/').get('/subroute1', (request, response, next) => {spy();});

            app.httpGet('/subroute1', (request, response) => {
                assert(spy.calledOnce);
                app.httpPost('/subroute1', (request, response) => {
                    assert(spy.calledOnce);
                    done();
                });
            });
        });

        it('on root path /route1 with sub path /subroute1', (done) => {
            const spy = sinon.spy();

            const app = frontexpress();
            app.set('http requester', requester);
            app.route('/route1').get('/subroute1', (request, response, next) => {spy();});

            app.httpGet('/route1/subroute1', (request, response) => {
                assert(spy.calledOnce);
                app.httpPost('/route1/subroute1', (request, response) => {
                    assert(spy.calledOnce);
                    done();
                });
            });
        });
    });

    describe('middleware object lifecycle', () => {
        beforeEach(()=>{
            requester = new Requester();
            sinon.stub(requester, 'fetch', ({uri, method, headers, data}, resolve, reject) => {
                resolve(
                    {uri, method, headers, data},
                    {status: 200, statusText: 'OK', responseText:''}
                );
            });
        });

        it('http GET request', (done) => {
            const app = frontexpress();
            app.set('http requester', requester);

            const getMiddleware = new MyMiddleware('get middleware');
            const spy_get_entered = sinon.spy(getMiddleware, 'entered');
            const spy_get_updated = sinon.spy(getMiddleware, 'updated');
            const spy_get_exited = sinon.spy(getMiddleware, 'exited');
            const spy_get_next = sinon.spy(getMiddleware, 'next');

            app.route('/route1').get(getMiddleware);

            app.httpGet({uri:'/route1', data: {p1: 'a', p2: 'b', p3: 'c'}}, (request, response) => {
                assert(spy_get_entered.callCount === 1);
                assert(spy_get_updated.callCount === 1);
                assert(spy_get_exited.callCount === 0);
                assert(spy_get_next.callCount === 2);

                assert(spy_get_entered.calledBefore(spy_get_updated));
                assert(spy_get_next.calledAfter(spy_get_entered));
                assert(spy_get_next.calledAfter(spy_get_updated));
                done();
            },
            (request, response) => {
                done(response);
            });
        });

        it('http GET followed by http POST requests', (done) => {
            const app = frontexpress();
            app.set('http requester', requester);

            const allMiddleware = new MyMiddleware('all middleware');
            const spy_all_entered = sinon.spy(allMiddleware, 'entered');
            const spy_all_updated = sinon.spy(allMiddleware, 'updated');
            const spy_all_exited = sinon.spy(allMiddleware, 'exited');

            const getMiddleware = new MyMiddleware('get middleware');
            const spy_get_entered = sinon.spy(getMiddleware, 'entered');
            const spy_get_updated = sinon.spy(getMiddleware, 'updated');
            const spy_get_exited = sinon.spy(getMiddleware, 'exited');

            const postMiddleware = new MyMiddleware('post middleware');
            const spy_post_entered = sinon.spy(postMiddleware, 'entered');
            const spy_post_updated = sinon.spy(postMiddleware, 'updated');
            const spy_post_exited = sinon.spy(postMiddleware, 'exited');

            app.route('/route1')
                .all(allMiddleware)
                .get(getMiddleware)
                .post(postMiddleware);

            app.httpGet('/route1', (request, response) => {
                assert(spy_all_entered.callCount === 1);
                assert(spy_all_updated.callCount === 1);
                assert(spy_all_exited.callCount === 0);
                assert(spy_all_entered.calledBefore(spy_get_entered));
                assert(spy_all_entered.calledBefore(spy_post_entered));

                assert(spy_get_entered.callCount === 1);
                assert(spy_get_updated.callCount === 1);
                assert(spy_get_exited.callCount === 0);
                assert(spy_get_entered.calledBefore(spy_post_entered));

                assert(spy_post_entered.callCount === 0);
                assert(spy_post_updated.callCount === 0);
                assert(spy_post_exited.callCount === 0);

                spy_all_entered.reset();
                spy_all_updated.reset();
                spy_all_exited.reset();

                spy_get_entered.reset();
                spy_get_updated.reset();
                spy_get_exited.reset();

                spy_post_entered.reset();
                spy_post_updated.reset();
                spy_post_exited.reset();

                app.httpPost('/route1', (request, response) => {
                    assert(spy_all_entered.callCount === 1);
                    assert(spy_all_updated.callCount === 1);
                    assert(spy_all_exited.callCount === 1);
                    assert(spy_all_exited.calledBefore(spy_all_entered));
                    assert(spy_all_exited.calledBefore(spy_all_updated));

                    assert(spy_get_entered.callCount === 0);
                    assert(spy_get_updated.callCount === 0);
                    assert(spy_get_exited.callCount === 1);

                    assert(spy_post_entered.callCount === 1);
                    assert(spy_post_updated.callCount === 1);
                    assert(spy_post_exited.callCount === 0);

                    done();
                }, (request, response) => {
                    done('should fail');
                });
            }, (request, response) => {
                done('should fail');
            });
        });

        it('request returning error', (done) => {
            requester = new Requester();
            sinon.stub(requester, 'fetch', ({uri, method, headers, data}, resolve, reject) => {
                reject(
                    {uri, method, headers, data},
                    {status: 404, statusText: 'page not found'}
                );
            });
            const app = frontexpress();
            app.set('http requester', requester);

            const getMiddleware = new MyMiddleware('get middleware');
            const spy_get_failed = sinon.spy(getMiddleware, 'failed');

            app.route('/route1').get(getMiddleware);

            app.httpGet('/route1', (request, response) => {
                done('should fail');
            },
            (request, response) => {
                assert(spy_get_failed.callCount === 1);
                done();
            });
        });

        it('next method', (done) => {
            const app = frontexpress();
            app.set('http requester', requester);

            const m1 = new MyMiddleware('m1');
            const m2 = new MyMiddleware('m2');
            m2.next = () => false;
            const m3 = new MyMiddleware('m3');

            const spy_m1 = sinon.spy(m1, 'updated');
            const spy_m2 = sinon.spy(m2, 'updated');
            const spy_m3 = sinon.spy(m3, 'updated');

            app.route('/route1').get(m1).get(m2).get(m3);
            app.httpGet('/route1', (request, response) => {
                assert(spy_m1.calledOnce);
                assert(spy_m2.calledOnce);
                assert(spy_m3.callCount === 0);
                done();
            });
        });
    });

    describe('middleware as function', () => {
        beforeEach(()=>{
            requester = new Requester();
            sinon.stub(requester, 'fetch', ({uri, method, headers, data}, resolve, reject) => {
                resolve(
                    {uri, method, headers, data},
                    {status: 200, statusText: 'OK', responseText:''}
                );
            });
        });

        it('next method', (done) => {
            const app = frontexpress();
            app.set('http requester', requester);

            const m1 = (req, res, next) => {next();};
            const m2 = (req, res, next) => {};
            const m3 = (req, res, next) => {next();};

            const spy_m1 = sinon.spy(m1);
            const spy_m2 = sinon.spy(m2);
            const spy_m3 = sinon.spy(m3);

            app.route('/route1').get(spy_m1).get(spy_m2).get(spy_m3);
            app.httpGet('/route1', (request, response) => {
                assert(spy_m1.calledOnce);
                assert(spy_m2.calledOnce);
                assert(spy_m3.callCount === 0);
                done();
            });
        });
    });

    describe('plugin management', () => {
        it('setup a plugin', (done) => {
            const app = frontexpress();
            app.use({
                name: 'my plugin',
                plugin(application) {
                    done();
                }
            });

            app.listen();

            //simulate readystatechange
            document.readyState = 'interactive';
            document.onreadystatechange();
        });
    });
});


text:
<?php
/**
This Example shows how to add a new API key using the MCAPI.php class and do
some basic error checking.
**/
require_once 'inc/MCAPI.class.php';
require_once 'inc/config.inc.php'; //contains apikey

$api = new MCAPI($apikey);

$retval = $api->apiKeyAdd($username, $password);

if ($api->errorCode){
	echo "Unable to load Add a New API Key()!";
	echo "\n\tCode=".$api->errorCode;
	echo "\n\tMsg=".$api->errorMessage."\n";
} else {
	echo "New API Key:".$retval."\n";
}

?>


text:
package com.scheible.springbootgettingstarted.singlemodule;

import com.scheible.pocketsaw.api.SubModule;
import com.scheible.springbootgettingstarted.singlemodule.ExternalFunctionalities.Slf4j;
import com.scheible.springbootgettingstarted.singlemodule.ExternalFunctionalities.SpringFramework;

/**
 *
 * @author sj
 */
@SubModule(uses = { SpringFramework.class, Slf4j.class })
public final class ApplicationSubModule {

	private ApplicationSubModule() {
	}
}