text:
BSLS_IDENT("$Id: $")

//@PURPOSE: Provide a C++03-compatible 'istringstream' class.
//
//@CLASSES:
//  bsl::istringstream: C++03-compatible 'istringstream' class
//
//@CANONICAL_HEADER: bsl_sstream.h
//
//@SEE_ALSO:
//
//@DESCRIPTION: This component is for internal use only.  Please include
// '<bsl_sstream.h>' instead.
//
// This component defines a class template, 'bsl::basic_istringstream',
// implementing a standard input stream that provides a constructor (as well as
// a manipulator) allowing clients to set the sequence of characters
// from which input is streamed to a supplied 'bsl::basic_string' (see
// 27.8.3 [istringstream] of the C++11 standard).  This component also defines
// two standard aliases, 'bsl::istringstream' and 'bsl::wistringstream', that
// refer to specializations of the 'bsl::basic_istringstream' template for
// 'char' and 'wchar_t' types, respectively.  The 'bsl::basic_istringstream'
// template has three parameters, 'CHAR_TYPE', 'CHAR_TRAITS', and 'ALLOCATOR'.
// The 'CHAR_TYPE' and 'CHAR_TRAITS' parameters respectively define the
// character type for the string-stream and a type providing a set of
// operations the string-stream will use to manipulate characters of that type,
// which must meet the character traits requirements defined by the C++11
// standard, 21.2 [char.traits].  The 'ALLOCATOR' template parameter is
// described in the "Memory Allocation" section below.
//
///Memory Allocation
///-----------------
// The type supplied as a string-stream's 'ALLOCATOR' template parameter
// determines how that string-stream will allocate memory.  The
// 'basic_istringstream' template supports allocators meeting the requirements
// of the C++11 standard, 17.6.3.5 [allocator.requirements]; in addition, it
// supports scoped-allocators derived from the 'bslma::Allocator' memory
// allocation protocol.  Clients intending to use 'bslma'-style allocators
// should use 'bsl::allocator', which provides a C++11 standard-compatible
// adapter for a 'bslma::Allocator' object.  Note that the standard aliases
// 'bsl::istringstream' and 'bsl::wistringstream' both use 'bsl::allocator'.
//
///'bslma'-Style Allocators
/// - - - - - - - - - - - -
// If the type supplied for the 'ALLOCATOR' template parameter of an
// 'istringstream' instantiation is 'bsl::allocator', then objects of that
// string-stream type will conform to the standard behavior of a
// 'bslma'-allocator-enabled type.  Such a string-stream accepts an optional
// 'bslma::Allocator' argument at construction.  If the address of a
// 'bslma::Allocator' object is explicitly supplied at construction, it will be
// used to supply memory for the string-stream throughout its lifetime;
// otherwise, the string-stream will use the default allocator installed at the
// time of the string-stream's construction (see 'bslma_default').
//
///Usage
///-----
// This section illustrates intended use of this component.
//
///Example 1: Basic Input Operations
///- - - - - - - - - - - - - - - - -
// The following example demonstrates the use of 'bsl::istringstream' to read
// data of various types from a 'bsl::string' object.
//
// Suppose we want to implement a simplified converter from 'bsl::string' to a
// generic type, 'TYPE'.  We use 'bsl::istringstream' to implement the
// 'fromString' function.  We initialize the input stream with the string
// passed as a parameter and then we read the data from the input stream with
// 'operator>>':
//..
//  template <class TYPE>
//  TYPE fromString(const bsl::string& from)
//  {
//      bsl::istringstream in(from);
//      TYPE val;
//      in >> val;
//      return val;
//  }
//..
// Finally, we verify that our 'fromString' function works on some simple test
// cases:
//..
//  assert(fromString<int>("1234") == 1234);
//
//  assert(fromString<short>("-5") == -5);
//
//  assert(fromString<bsl::string>("abc") == "abc");
//..

#include <bslscm_version.h>

#include <bslma_isstdallocator.h>
#include <bslma_usesbslmaallocator.h>

#include <bslmf_enableif.h>
#include <bslmf_issame.h>
#include <bslmf_movableref.h>

#include <bsls_compilerfeatures.h>
#include <bsls_keyword.h>
#include <bsls_libraryfeatures.h>
#include <bsls_platform.h>

#include <bslstl_string.h>
#include <bslstl_stringview.h>
#include <bslstl_stringbuf.h>

#include <ios>

#include <istream>

#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
# include <utility>
#endif

namespace bsl {

                          // =========================
                          // class basic_istringstream
                          // =========================

template <class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
class basic_istringstream
    : private StringBufContainer<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>
    , public std::basic_istream<CHAR_TYPE, CHAR_TRAITS> {
    // This class implements a standard input stream that provides a
    // constructor and manipulator for setting the sequence of characters from
    // which input is streamed to a supplied 'bsl::basic_string'.

  private:
    // PRIVATE TYPES
    typedef basic_stringbuf<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>   StreamBufType;
    typedef StringBufContainer<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>
                                                                 BaseType;
    typedef bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR> StringType;
    typedef bsl::basic_string_view<CHAR_TYPE, CHAR_TRAITS>       ViewType;
    typedef std::basic_istream<CHAR_TYPE, CHAR_TRAITS>           BaseStream;
    typedef std::ios_base                                        ios_base;

    typedef BloombergLP::bslmf::MovableRefUtil                   MoveUtil;

  private:
    // NOT IMPLEMENTED
    basic_istringstream(const basic_istringstream&);             // = delete
    basic_istringstream& operator=(const basic_istringstream&);  // = delete

  public:
    // TYPES
    typedef CHAR_TYPE                       char_type;
    typedef CHAR_TRAITS                     traits_type;
    typedef ALLOCATOR                       allocator_type;
    typedef typename traits_type::int_type  int_type;
    typedef typename traits_type::off_type  off_type;
    typedef typename traits_type::pos_type  pos_type;

    // CREATORS
    explicit
    basic_istringstream(const allocator_type& allocator = allocator_type());
    explicit
    basic_istringstream(ios_base::openmode    modeBitMask,
                        const allocator_type& allocator = allocator_type());
    explicit
    basic_istringstream(const StringType&     initialString,
                        const allocator_type& allocator = allocator_type());
    basic_istringstream(const StringType&     initialString,
                        ios_base::openmode    modeBitMask,
                        const allocator_type& allocator = allocator_type());
        // Create a 'basic_istringstream' object.  Optionally specify a
        // 'modeBitMask' indicating whether the underlying stream-buffer may
        // also be written to ('rdbuf' is created using
        // 'modeBitMask | ios_base::in').  If 'modeBitMask' is not supplied,
        // 'rdbuf' will be created using 'ios_base::in'.  Optionally specify an
        // 'initialString' indicating the sequence of characters from which
        // input will be streamed.  If 'initialString' is not supplied, there
        // will not be data to stream (until a subsequent call to the 'str'
        // manipulator).  Optionally specify the 'allocator' used to supply
        // memory.  If 'allocator' is not supplied, a default-constructed
        // object of the (template parameter) 'ALLOCATOR' type is used.  If the
        // 'ALLOCATOR' argument is of type 'bsl::allocator' (the default), then
        // 'allocator', if supplied, shall be convertible to
        // 'bslma::Allocator *'.  If the 'ALLOCATOR' argument is of type
        // 'bsl::allocator' and 'allocator' is not supplied, the currently
        // installed default allocator will be used to supply memory.  If
        // 'initialString' is passed by 'MovableRef', it is left in a valid but
        // unspecified state.

    explicit
    basic_istringstream(
                     BloombergLP::bslmf::MovableRef<StringType> initialString);
    basic_istringstream(
                      BloombergLP::bslmf::MovableRef<StringType> initialString,
                      const allocator_type&                      allocator);
    basic_istringstream(
                      BloombergLP::bslmf::MovableRef<StringType> initialString,
                      ios_base::openmode                         modeBitMask);
    basic_istringstream(
                      BloombergLP::bslmf::MovableRef<StringType> initialString,
                      ios_base::openmode                         modeBitMask,
                      const allocator_type&                      allocator);
        // Create a 'basic_istringstream' object.  Use the specified
        // 'initialString' indicating the initial sequence of characters from
        // which input will be streamed.  Optionally specify a 'modeBitMask'
        // indicating whether the underlying stream-buffer may also be written
        // to ('rdbuf' is created using 'modeBitMask | ios_base::in').  If
        // 'modeBitMask' is not supplied, 'rdbuf' will be created using
        // 'ios_base::in'.  Optionally specify the 'allocator' used to supply
        // memory.  If 'allocator' is not supplied, the allocator in
        // 'initialString' is used.  'initialString' is left in a valid but
        // unspecified state.

    template <class SALLOC>
    basic_istringstream(
        const bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, SALLOC>&
                                                  initialString,
        const allocator_type&                     allocator = allocator_type(),
        typename bsl::enable_if<
                    !bsl::is_same<ALLOCATOR, SALLOC>::value, void *>::type = 0)
        // Create a 'basic_istringstream' object.  Use the specified
        // 'initialString' indicating the sequence of characters from which
        // input will be streamed.  'rdbuf' is created using 'ios_base::in'.
        // Optionally specify the 'allocator' used to supply memory.  If
        // 'allocator' is not supplied, a default-constructed object of the
        // (template parameter) 'ALLOCATOR' type is used.  If the 'ALLOCATOR'
        // argument is of type 'bsl::allocator' (the default), then
        // 'allocator', if supplied, shall be convertible to
        // 'bslma::Allocator *'.  If the 'ALLOCATOR' argument is of type
        // 'bsl::allocator' and 'allocator' is not supplied, the currently
        // installed default allocator will be used to supply memory.
        //
        // Note: implemented inline due to Sun CC compilation error.
    : BaseType(initialString.begin(),
               initialString.end(),
               ios_base::in,
               allocator)
    , BaseStream(BaseType::rdbuf())
    {
    }

    template <class SALLOC>
    basic_istringstream(
        const bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, SALLOC>&
                                                  initialString,
        ios_base::openmode                        modeBitMask,
        const allocator_type&                     allocator = allocator_type(),
        typename bsl::enable_if<
                    !bsl::is_same<ALLOCATOR, SALLOC>::value, void *>::type = 0)
        // Create a 'basic_istringstream' object.  Use the specified
        // 'initialString' indicating the sequence of characters from which
        // input will be streamed.  Use the specified 'modeBitMask' to indicate
        // whether this buffer may be read from, written to, or both.
        // Optionally specify the 'allocator' used to supply memory.  If
        // 'allocator' is not supplied, a default-constructed object of the
        // (template parameter) 'ALLOCATOR' type is used.  If the 'ALLOCATOR'
        // argument is of type 'bsl::allocator' (the default), then
        // 'allocator', if supplied, shall be convertible to
        // 'bslma::Allocator *'.  If the 'ALLOCATOR' argument is of type
        // 'bsl::allocator' and 'allocator' is not supplied, the currently
        // installed default allocator will be used to supply memory.
        //
        // Note: implemented inline due to Sun CC compilation error.
    : BaseType(initialString.begin(),
               initialString.end(),
               modeBitMask | ios_base::in,
               allocator)
    , BaseStream(BaseType::rdbuf())
    {
    }

#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
    basic_istringstream(basic_istringstream&& original);
        // Create a 'basic_istringstream' object having the same value as the
        // specified 'original' object by moving the contents of 'original' to
        // the newly-created object.  'original' is left in a valid but
        // unspecified state.
#endif

    //! ~basic_istringstream() = default;
        // Destroy this object.

    // MANIPULATORS
#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
    basic_istringstream& operator=(basic_istringstream&& rhs);
        // Assign to this object the value of the specified 'rhs', and return a
        // reference providing modifiable access to this object.  The contents
        // of 'rhs' are move-assigned to this object.  'rhs' is left in a valid
        // but unspecified state.
#endif

    void str(const StringType& value);
    void str(BloombergLP::bslmf::MovableRef<StringType> value);
    template <class SALLOC>
    typename
        bsl::enable_if<!bsl::is_same<ALLOCATOR, SALLOC>::value, void>::type
    str(const basic_string<CHAR_TYPE, CHAR_TRAITS, SALLOC>& value)
        // Reset the internally buffered sequence of characters provided as
        // input by this stream to the specified 'value'.  If 'value' is passed
        // by 'MovableRef', it is left in a valid but unspecified state.
        //
        // Note: implemented inline due to Sun CC compilation error.
    {
        this->rdbuf()->str(value);
    }

#ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
    StringType str() &&;
        // Return the internally buffered sequence of characters maintained by
        // this stream, leaving the stream empty.
#endif

    // ACCESSORS
    StreamBufType *rdbuf() const;
        // Return an address providing modifiable access to the
        // 'basic_stringbuf' object that is internally used by this string
        // stream to buffer unformatted characters.

#ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
    StringType str() const &;
#else
    StringType str() const;
#endif
        // Return the internally buffered sequence of characters maintained by
        // this stream object.

#ifndef BSLS_PLATFORM_CMP_SUN
    // To be enabled once {DRQS 168075157} is resolved
    template <class SALLOC>
    typename bsl::enable_if<
        bsl::IsStdAllocator<SALLOC>::value,
        basic_string<CHAR_TYPE, CHAR_TRAITS, SALLOC> >::type
    str(const SALLOC& allocator) const
        // Return a copy of the internally buffered sequence of characters
        // maintained by this stream object in a 'basic_string' that uses the
        // specified 'allocator'.
        //
        // Note: implemented inline due to Sun CC compilation error.
    {
        return this->rdbuf()->str(allocator);
    }
#endif

    ViewType view() const BSLS_KEYWORD_NOEXCEPT;
        // Return a view of the internally buffered sequence of characters
        // maintained by this stream object.
};

// STANDARD TYPEDEFS
typedef basic_istringstream<char, char_traits<char>, allocator<char> >
                                                                 istringstream;
typedef basic_istringstream<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >
                                                                wistringstream;

// ============================================================================
//                       TEMPLATE FUNCTION DEFINITIONS
// ============================================================================

                          // -------------------------
                          // class basic_istringstream
                          // -------------------------

// CREATORS
template <class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
inline
basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::
basic_istringstream(const allocator_type& allocator)
: BaseType(ios_base::in, allocator)
, BaseStream(BaseType::rdbuf())
{
}

template <class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
inline
basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::
basic_istringstream(ios_base::openmode    modeBitMask,
                    const allocator_type& allocator)
: BaseType(modeBitMask | ios_base::in, allocator)
, BaseStream(BaseType::rdbuf())
{
}

template <class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
inline
basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::
basic_istringstream(const StringType&     initialString,
                    const allocator_type& allocator)
: BaseType(initialString, ios_base::in, allocator)
, BaseStream(BaseType::rdbuf())
{
}

template <class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
inline
basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::
basic_istringstream(const StringType&     initialString,
                    ios_base::openmode    modeBitMask,
                    const allocator_type& allocator)
: BaseType(initialString, modeBitMask | ios_base::in, allocator)
, BaseStream(BaseType::rdbuf())
{
}

template <class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
inline
basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::
basic_istringstream(BloombergLP::bslmf::MovableRef<StringType> initialString)
: BaseType(MoveUtil::move(initialString), ios_base::in)
, BaseStream(BaseType::rdbuf())
{
}

template <class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
inline
basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::
basic_istringstream(BloombergLP::bslmf::MovableRef<StringType> initialString,
                    const allocator_type&                      allocator)
: BaseType(MoveUtil::move(initialString), ios_base::in, allocator)
, BaseStream(BaseType::rdbuf())
{
}

template <class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
inline
basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::
basic_istringstream(BloombergLP::bslmf::MovableRef<StringType> initialString,
                    ios_base::openmode                         modeBitMask)
: BaseType(MoveUtil::move(initialString), modeBitMask | ios_base::in)
, BaseStream(BaseType::rdbuf())
{
}

template <class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
inline
basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::
basic_istringstream(BloombergLP::bslmf::MovableRef<StringType> initialString,
                    ios_base::openmode                         modeBitMask,
                    const allocator_type&                      allocator)
: BaseType(MoveUtil::move(initialString),
           modeBitMask | ios_base::in,
           allocator)
, BaseStream(BaseType::rdbuf())
{
}

#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
template <class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
inline
basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::
basic_istringstream(basic_istringstream&& original)
: BaseType(std::move(original))
, BaseStream(std::move(original))
{
    BaseStream::set_rdbuf(BaseType::rdbuf());
}
#endif

// MANIPULATORS
#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
template <class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
inline
basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>&
basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::
operator=(basic_istringstream&& rhs)
{
    this->BaseType::operator=(std::move(rhs));
    this->BaseStream::operator=(std::move(rhs));

    return *this;
}
#endif

template <class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
inline
void basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::str(
                                                       const StringType& value)
{
    this->rdbuf()->str(value);
}

template <class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
inline
void basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::str(
                              BloombergLP::bslmf::MovableRef<StringType> value)
{
    this->rdbuf()->str(MoveUtil::move(value));
}

#ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
template <class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
inline
typename basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::StringType
basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::str() &&
{
    return std::move(*this->rdbuf()).str();
}
#endif

// ACCESSORS
template <class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
inline
typename
basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::StreamBufType *
basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::rdbuf() const
{
    return this->BaseType::rdbuf();
}

#ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
template <class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
inline
typename basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::StringType
basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::str() const &
{
    return this->rdbuf()->str();
}
#else
template <class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
inline
typename basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::StringType
basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::str() const
{
    return this->rdbuf()->str();
}
#endif

template <class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
inline
typename basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::ViewType
basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::view()
                                                    const BSLS_KEYWORD_NOEXCEPT
{
    return this->rdbuf()->view();
}

}  // close namespace bsl

// ============================================================================
//                                TYPE TRAITS
// ============================================================================

namespace BloombergLP {
namespace bslma {

template <class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
struct UsesBslmaAllocator<
        bsl::basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR> >
    : bsl::true_type
{};

}  // close namespace bslma
}  // close enterprise namespace

#endif

// ----------------------------------------------------------------------------
// Copyright 2013 Bloomberg Finance L.P.
//
// 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.
// ----------------------------- END-OF-FILE ----------------------------------


text:
<?php

declare(strict_types=1);

use Sonata\UserBundle\Action\CheckEmailAction;
use Sonata\UserBundle\Action\CheckLoginAction;
use Sonata\UserBundle\Action\LoginAction;
use Sonata\UserBundle\Action\LogoutAction;
use Sonata\UserBundle\Action\RequestAction;
use Sonata\UserBundle\Action\ResetAction;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symfony\Component\DependencyInjection\Loader\Configurator\ReferenceConfigurator;

return static function (ContainerConfigurator $containerConfigurator): void {
    // Use "service" function for creating references to services when dropping support for Symfony 4.4
    // Use "param" function for creating references to parameters when dropping support for Symfony 5.1
    $containerConfigurator->services()

        ->set('sonata.user.action.request', RequestAction::class)
            ->public()
            ->args([
                new ReferenceConfigurator('twig'),
                new ReferenceConfigurator('router'),
                new ReferenceConfigurator('security.authorization_checker'),
                new ReferenceConfigurator('sonata.admin.pool'),
                new ReferenceConfigurator('sonata.admin.global_template_registry'),
                new ReferenceConfigurator('form.factory'),
                new ReferenceConfigurator('sonata.user.manager.user'),
                new ReferenceConfigurator('sonata.user.mailer'),
                new ReferenceConfigurator('sonata.user.util.token_generator'),
                0,
            ])

        ->set('sonata.user.action.check_email', CheckEmailAction::class)
            ->public()
            ->args([
                new ReferenceConfigurator('twig'),
                new ReferenceConfigurator('router'),
                new ReferenceConfigurator('sonata.admin.pool'),
                new ReferenceConfigurator('sonata.admin.global_template_registry'),
                0,
            ])

        ->set('sonata.user.action.reset', ResetAction::class)
            ->public()
            ->args([
                new ReferenceConfigurator('twig'),
                new ReferenceConfigurator('router'),
                new ReferenceConfigurator('security.authorization_checker'),
                new ReferenceConfigurator('sonata.admin.pool'),
                new ReferenceConfigurator('sonata.admin.global_template_registry'),
                new ReferenceConfigurator('form.factory'),
                new ReferenceConfigurator('sonata.user.manager.user'),
                new ReferenceConfigurator('translator'),
                0,
            ])

        ->set('sonata.user.action.login', LoginAction::class)
            ->public()
            ->args([
                new ReferenceConfigurator('twig'),
                new ReferenceConfigurator('router'),
                new ReferenceConfigurator('security.authentication_utils'),
                new ReferenceConfigurator('sonata.admin.pool'),
                new ReferenceConfigurator('sonata.admin.global_template_registry'),
                new ReferenceConfigurator('security.token_storage'),
                new ReferenceConfigurator('translator'),
                (new ReferenceConfigurator('security.csrf.token_manager'))->nullOnInvalid(),
            ])

        ->set('sonata.user.action.check_login', CheckLoginAction::class)
            ->public()

        ->set('sonata.user.action.logout', LogoutAction::class)
            ->public();
};

redpajama_set_name: RedPajamaGithub


text:
package com.grizzly.functions.Storage.Json;

import android.content.Context;

import java.io.Serializable;

/**
 * Created by FcoPardo on 5/16/16.
 */
public class PersistenceStaticProvider {

    private static PersistenceFactory factory = new PersistenceFactory();

    public static <T extends Serializable> Persistence<T> getJsonPersistence(Class<T> classToPersist, Context context){
        return factory.getJsonPersistence(classToPersist, context);
    }
}


text:
package org.wso2.developerstudio.eclipse.gmf.esb.diagram.custom.editpolicy;

import java.awt.MouseInfo;
import java.awt.Point;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import org.eclipse.draw2d.FigureCanvas;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.ImageFigure;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.Request;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gef.requests.ChangeBoundsRequest;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Control;
import org.wso2.developerstudio.eclipse.gmf.esb.diagram.custom.AbstractEndpoint;
import org.wso2.developerstudio.eclipse.gmf.esb.diagram.custom.AbstractMediator;
import org.wso2.developerstudio.eclipse.gmf.esb.diagram.custom.EndpoinMediatorFlowCompartmentEditPart;
import org.wso2.developerstudio.eclipse.gmf.esb.diagram.edit.parts.MediatorFlowMediatorFlowCompartment11EditPart;
import org.wso2.developerstudio.eclipse.gmf.esb.diagram.providers.EsbElementTypes;
import org.wso2.developerstudio.eclipse.platform.core.utils.SWTResourceManager;

/**
 * Installing <b>FeedbackIndicateDragDropEditPolicy</b> will indicate a feedback when drag a node
 * to the canvas from the tool palette
 */
public class FeedbackIndicateDragDropEditPolicy extends DragDropEditPolicy {

	private IFigure feedbackFigure;
	private Image feedbackImage;

	private static final String ALLOW_DROP_ICON_PATH = "/icons/custom/check.png";
	private static final String NOT_ALLOW_DROP_ICON_PATH = "/icons/custom/exclamation.png";

	/**
	 * {@inheritDoc}
	 */
	protected Command getDropCommand(ChangeBoundsRequest request) {
		if ((getHost() instanceof ShapeCompartmentEditPart)) {
			/* avoiding drag and drop nodes between compartments. */
			return null;
		}
		return super.getDragCommand(request);
	}

	/**
	 * {@inheritDoc}
	 */
	public void showTargetFeedback(Request request) {
		super.showTargetFeedback(request);
		if (request instanceof CreateUnspecifiedTypeRequest) {
			if (getHost() instanceof ShapeCompartmentEditPart) {
				ShapeCompartmentEditPart host = (ShapeCompartmentEditPart) getHost();
				Command command = host.getCommand(request);
				if (command != null) {
					if (command.canExecute()) {
						showFeedBackFigure(true);
					} else {
						showFeedBackFigure(false);
					}
				} else {
					showFeedBackFigure(false);
				}
			} else {
				if (getHost() instanceof AbstractEndpoint) {
					showFeedBackFigure(true);
				} else {
					showFeedBackFigure(false);
				}

			}
		}
	}

	/**
	 * {@inheritDoc}
	 */
	public void eraseTargetFeedback(Request request) {
		if (feedbackFigure != null) {
			removeFeedback(feedbackFigure);
			feedbackFigure = null;
		}
		super.eraseTargetFeedback(request);
	}

	/**
	 * Get feedback figure
	 * @param allowDrop true if, host is acceptable area for a certain node.
	 * @return
	 */
	public IFigure getFeedbackFigure(boolean allowDrop) {
		if (feedbackFigure == null) {
			Image feedbackImage = SWTResourceManager.getImage(this.getClass(),
					(allowDrop) ? ALLOW_DROP_ICON_PATH : NOT_ALLOW_DROP_ICON_PATH);
			IFigure figure = new ImageFigure(feedbackImage);
			addFeedback(figure);
			this.feedbackImage = feedbackImage;
			feedbackFigure = figure;
		}
		return feedbackFigure;
	}

	/**
	 * Show feedback figure in canvas
	 * @param allowDrop  true if, host is acceptable area for a certain node.
	 */
	private void showFeedBackFigure(boolean allowDrop) {
		Point pointer = MouseInfo.getPointerInfo().getLocation();
		IFigure feedbackFigure = getFeedbackFigure(allowDrop);
		int x = (int) pointer.getX();
		int y = (int) pointer.getY();
		Control ctrl = getHost().getViewer().getControl();
		FigureCanvas canvas = (FigureCanvas) ctrl;
		int horizontal = canvas.getHorizontalBar().getSelection();
		int vertical = canvas.getVerticalBar().getSelection();
		horizontal += 15;
		vertical -= 15;
		org.eclipse.swt.graphics.Point p = canvas.toDisplay(0, 0);
		feedbackFigure.setBounds(new Rectangle((x - p.x) + horizontal, (y - p.y) + vertical,
				feedbackImage.getBounds().width, feedbackImage.getBounds().height));
	}

	/**
	 * {@inheritDoc}
	 */
	public Command getCommand(Request request) {

		if (request instanceof CreateUnspecifiedTypeRequest) {
			List<IElementType> endPointTypes = Arrays.asList(
					EsbElementTypes.AddressEndPoint_3610,
					EsbElementTypes.AddressEndPoint_3646,
					EsbElementTypes.AddressingEndpoint_3689,
					EsbElementTypes.DefaultEndPoint_3609,
					EsbElementTypes.DefaultEndPoint_3643,
					EsbElementTypes.HTTPEndpoint_3709,
					EsbElementTypes.HTTPEndpoint_3712,
					EsbElementTypes.WSDLEndPoint_3612,
					EsbElementTypes.WSDLEndPoint_3653,
					EsbElementTypes.RecipientListEndPoint_3692,
					EsbElementTypes.RecipientListEndPoint_3696,
					EsbElementTypes.TemplateEndpoint_3716,
					EsbElementTypes.TemplateEndpoint_3725,
					EsbElementTypes.NamedEndpoint_3660,
					EsbElementTypes.LoadBalanceEndPoint_3613,
					EsbElementTypes.LoadBalanceEndPoint_3656,
					EsbElementTypes.FailoverEndPoint_3611,
					EsbElementTypes.FailoverEndPoint_3649);

			@SuppressWarnings("rawtypes")
			List elementTypes = ((CreateUnspecifiedTypeRequest) request).getElementTypes();
				@SuppressWarnings("rawtypes")
				Iterator types = elementTypes.iterator();
				while(types.hasNext()){
					Object object = types.next();

					if (!(getHost() instanceof EndpoinMediatorFlowCompartmentEditPart)) {

						/*
						 * Doesn't allow adding Endpoints in mediators other than
						 * Send and Call
						 */

						if (!(getHost() instanceof MediatorFlowMediatorFlowCompartment11EditPart)) {
						   /*
							* Allow adding Endpoints in Clone Mediator and not in
							* other mediators
							*/
							if (endPointTypes.contains(object)) {
								return UnexecutableCommand.INSTANCE;
							}
						}

						if (getHost() instanceof MediatorFlowMediatorFlowCompartment11EditPart) {

							int count = getHost().getChildren().size();
							if (count > 0) {
								Object existingMediator = getHost().getChildren()
										.get(count - 1);
								if (existingMediator instanceof AbstractEndpoint) {
	                            /*
								 *If the last mediator is an Endpoint, then not
								 *allow to add other mediators
								 */
									if (!endPointTypes.contains(object)) {
										return UnexecutableCommand.INSTANCE;
									}

								} else if (existingMediator instanceof AbstractMediator) {
									/*
									 * If the last mediator is not an Endpoint and
									 * if it is another mediator, then not allow to
									 * add endpoints without a Send
									 */
									if (endPointTypes.contains(object)) {
										return UnexecutableCommand.INSTANCE;
									}
								}
							}
						}

					} else {

						/*
						 *Not allowing mediators in Send and Call mediator
						 *compartments.
	                     */
						if (!endPointTypes.contains(object)) {
							return UnexecutableCommand.INSTANCE;
						}
					}

				}
			}
		return super.getCommand(request);
	}

}


text:
import { Advice } from './advice';
import { Metadata, MethodMetadata } from './metadata';

export interface Precondition {
  assert(data: any): boolean;
}

export abstract class JoinPoint {
  constructor(public precondition: Precondition) {}

  public abstract match(descriptor: Function): string[];

  protected abstract getTarget(fn: Function): Object;

  protected abstract wrapTarget(target: Object, match: string, advice: Advice, advisedMetadata: any): void;

  public apply(
    { fn, matches, advisedMetadata }: { fn: Function; matches: string[]; advisedMetadata: any },
    advice: Advice
  ): void {
    const target = this.getTarget(fn);
    matches.forEach((match: string) => {
      this.wrapTarget(target, match, advice, advisedMetadata);
    });
  }

  protected getMetadata(
    className: string,
    key: string,
    fn: Function,
    args: IArguments,
    context: any,
    advisedMetadata: any
  ): Metadata {
    const boundFn = fn.bind(context);

    var invocation: MethodMetadata = {
      name: key,
      proceed: true,
      context: context,
      result: undefined,
      exception: undefined,
      args: undefined,
      invoke: boundFn,
      complete: function complete(...args: any[]): any {
        this.method.proceed = false;
        return boundFn.apply(null, args);
      }
    };

    var metadata: Metadata = new Metadata();
    metadata.method = invocation;
    metadata.className = className;
    metadata.advisedMetadata = advisedMetadata;
    if (args[0] && args[0].__advice_metadata__) {
      let previousMetadata = <Metadata>args[0];
      metadata.method.result = previousMetadata.method.result;
      metadata.method.proceed = previousMetadata.method.proceed;
      metadata.method.args = previousMetadata.method.args;
      metadata.method.context = previousMetadata.method.context;
    } else {
      metadata.method.args = Array.prototype.slice.call(args);
      metadata.method.complete = metadata.method.complete.bind(metadata);
    }
    return metadata;
  }
}

/**
 * Kept for backward compability only.
 * Use {@link JoinPoint} instead.
 *
 * @deprecated renamed to JoinPoint
 * @see JoinPoint
 */
export abstract class JointPoint extends JoinPoint {
  constructor(public precondition: Precondition) {
    super(precondition);
  }
}


text:
    ((type_ *)((char *)ptr_ - offsetof(type_, member_)))

static void cache_decref(db_cache_entry_t *entry)
{
    if (--entry->refcount == 0)
    {
        la_db_close(entry->db);
        free(entry->name);
        free(entry);
    }
}

static void cache_incref(db_cache_entry_t *entry)
{
    entry->refcount++;
}

void db_cache_init(db_cache_t *cache, int maxsize)
{
    pthread_mutex_init(&cache->mutex, PTHREAD_MUTEX_NORMAL);
    cache->maxsize = maxsize;
    cache->head = NULL;
}

void db_cache_destroy(db_cache_t *cache)
{

}

la_db_open_result_t db_cache_open(db_cache_t *cache, la_host_t *host, const char *name, int flags, la_db_t **db)
{
    pthread_mutex_lock(&cache->mutex);
    db_cache_entry_t *found;
    HASH_FIND_STR(cache->head, name, found);
    if (found == NULL)
    {
        found = (db_cache_entry_t *) malloc(sizeof(db_cache_entry_t));
        if (found == NULL)
        {
            pthread_mutex_unlock(&cache->mutex);
            return LA_DB_OPEN_ERROR;
        }
        found->name = strdup(name);
        la_db_open_result_t result = la_db_open(host, name, flags, &found->db);
        if (result != LA_DB_OPEN_OK && result != LA_DB_OPEN_CREATED)
        {
            free(found->name);
            free(found);
            pthread_mutex_unlock(&cache->mutex);
            return result;
        }
        HASH_ADD_STR(cache->head, name, found);
        cache_incref(found);
        if (HASH_COUNT(cache->head) > cache->maxsize)
        {
            db_cache_entry_t *e, *tmp;
            HASH_ITER(hh, cache->head, e, tmp)
            {
                HASH_DELETE(hh, cache->head, e);
                cache_decref(e);
                break;
            }
        }
        pthread_mutex_unlock(&cache->mutex);
        *db = found->db;
        return result;
    }

    HASH_DELETE(hh, cache->head, found);
    HASH_ADD_STR(cache->head, name, found);

    pthread_mutex_unlock(&cache->mutex);
    if ((flags & (LA_DB_OPEN_FLAG_CREATE|LA_DB_OPEN_FLAG_EXCL)) == (LA_DB_OPEN_FLAG_CREATE|LA_DB_OPEN_FLAG_EXCL))
        return LA_DB_OPEN_EXISTS;

    cache_incref(found);
    *db = found->db;
    return LA_DB_OPEN_OK;
}

void db_cache_close(db_cache_t *cache, la_db_t *db)
{
    db_cache_entry_t *entry = __container_of(db, db_cache_entry_t, db);
    cache_decref(entry);
}


text:
package de.pascaldierich.domain.executor.impl;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

import de.pascaldierich.domain.executor.Executor;
import de.pascaldierich.domain.interactors.base.AbstractInteractor;

public class ThreadExecutor implements Executor {
    // This is a singleton
    private static volatile ThreadExecutor sThreadExecutor;

    private static final int CORE_POOL_SIZE = 3;
    private static final int MAX_POOL_SIZE = 5;
    private static final int KEEP_ALIVE_TIME = 120;
    private static final TimeUnit TIME_UNIT = TimeUnit.SECONDS;
    private static final BlockingQueue<Runnable> WORK_QUEUE = new LinkedBlockingQueue<>();

    private ThreadPoolExecutor mThreadPoolExecutor;

    private ThreadExecutor() {
        long keepAlive = KEEP_ALIVE_TIME;
        mThreadPoolExecutor = new ThreadPoolExecutor(
                CORE_POOL_SIZE,
                MAX_POOL_SIZE,
                keepAlive,
                TIME_UNIT,
                WORK_QUEUE);
    }

    @Override
    public void execute(final AbstractInteractor interactor) {
        mThreadPoolExecutor.submit(new Runnable() {
            @Override
            public void run() {
                // run the main logic
                interactor.run();

                // mark it as finished
                interactor.onFinished();
            }
        });
    }

    /**
     * Returns a singleton instance of this executor. If the executor is not initialized then it initializes it and returns
     * the instance.
     */
    public static Executor getInstance() {
        if (sThreadExecutor == null) {
            sThreadExecutor = new ThreadExecutor();
        }

        return sThreadExecutor;
    }
}


text:
<?php

namespace ec2m\ec2mBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class Ec2mCategoriaIdiomaType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('nombre')
            ->add('slug')
            ->add('h1')
            ->add('resumen')
            ->add('descripcion')
            ->add('title')
            ->add('metakeywords')
            ->add('metadescription')
            ->add('ts')
            ->add('idCategoria')
            ->add('idioma')
        ;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'ec2m\ec2mBundle\Entity\Ec2mCategoriaIdioma'
        ));
    }

    public function getName()
    {
        return 'ec2m_ec2mbundle_ec2mcategoriaidiomatype';
    }
}


text:
'use strict';

module.exports = (it, expect, collect) => {
  it('should skip all values before a given value appears', () => {
    const collection = collect([1, 1, 2, 2, 3, 3, 4, 4]);

    expect(collection.skipUntil(3)).to.eql(collect([3, 3, 4, 4]));
    expect(collection.skipUntil(3).all()).to.eql([3, 3, 4, 4]);

    expect(collection.skipUntil(1)).to.eql(collect([1, 1, 2, 2, 3, 3, 4, 4]));
    expect(collection.skipUntil(1).all()).to.eql([1, 1, 2, 2, 3, 3, 4, 4]);
  });

  it('should accept a callback', () => {
    const collection = collect([1, 2, 3, 4]);

    const subset = collection.skipUntil(item => item >= 3);

    expect(subset.all()).to.eql([3, 4]);
  });

  it('should work with collection based on an object', () => {
    const collection = collect({
      name: 'Sadio Mané',
      number: 10,
      club: 'Liverpool FC',
    });

    expect(collection.skipUntil('Liverpool FC')).to.eql(collect({
      club: 'Liverpool FC',
    }));
    expect(collection.skipUntil('Liverpool FC').all()).to.eql({
      club: 'Liverpool FC',
    });

    expect(collection.skipUntil('Sadio Mané').isNotEmpty()).to.eql(true);
    expect(collection.skipUntil('Sadio Mané').all()).to.eql({
      club: 'Liverpool FC',
      name: 'Sadio Mané',
      number: 10,
    });
  });

  it('should work when multidimentional', () => {
    const data = [{
      name: 'Sadio Mané',
      number: 10,
      club: 'Liverpool FC',
    }, {
      name: 'Mohamed Salah',
      number: 11,
      club: 'Liverpool FC',
    }];

    const collection = collect(data);

    expect(collection.skipUntil('Liverpool FC').isEmpty()).to.eql(true);
    expect(collection.skipUntil('Liverpool FC')).to.eql(collect());
    expect(collection.skipUntil('Liverpool FC').all()).to.eql([]);
  });
};


text:
import { browser, by, element, ExpectedConditions } from 'protractor';
import { isLoaded, login, logout, delay } from './utils';
import { request, header } from '../tests/e2e/webhooks/gitlab/PushEvents';
import { request as prReq, header as prHead } from '../tests/e2e/webhooks/gitlab/MergeEvents';
import { sendGitLabRequest } from '../tests/e2e/utils/utils';
import * as chai from 'chai';
import * as chaiAsPromised from 'chai-as-promised';

chai.use(chaiAsPromised);
const expect = chai.expect;

describe('Gitlab repositories', () => {
  before(() => login().then(() => browser.waitForAngularEnabled(false)));
  after(() => logout().then(() => browser.waitForAngularEnabled(true)));

  it('should add gitlab repository and start new build (send push event)', () => {
    return browser.wait(() => {
        return element.all(by.css('.is-running')).count().then(count => count === 0);
      })
      .then(() => sendGitLabRequest(request, header))
      .then(() => browser.wait(() => {
        return element.all(by.css('.is-running')).count().then(count => count === 1);
      }))
      .then(() => browser.get('/repositories'))
      .then((): any => isLoaded())
      .then((): any => browser.wait(() => element(by.css('.bold')).isPresent()))
      .then(() => {
        expect(element.all(by.css('.bold')).last().getText()).to.eventually.include('d3-bundle');
      })
      .then(() => browser.get('/'))
      .then(() => delay(3000))
      .then((): any => browser.wait(() => {
        return element.all(by.css('.stop-build')).first().isPresent();
      }))
      .then((): any => browser.wait(() => {
        return element.all(by.css('.stop-build')).first().isDisplayed();
      }))
      .then(() => delay(2000))
      .then((): any => element.all(by.css('.stop-build')).first().click())
      .then((): any => browser.wait(() => {
        return element.all(by.css('.is-running')).count().then(count => count === 0);
      }));
  });

  it('should start new build (send reopen_pull_request event)', () => {
    return sendGitLabRequest(prReq, prHead)
      .then((): any => browser.wait(() => {
        return element.all(by.css('.is-running')).count().then(count => count === 1);
      }))
      .then((): any => browser.wait(() => {
        return element(by.css('.build-time')).isPresent();
      }))
      .then((): any => browser.wait(() => {
        return element.all(by.css('.disabled')).count().then(cnt => cnt === 0);
      }))
      .then((): any => browser.wait(() => {
        return element.all(by.css('.list-item:nth-child(1) .stop-build')).isPresent();
      }))
      .then((): any => browser.wait(() => {
        return element.all(by.css('.list-item:nth-child(1) .stop-build')).isEnabled();
      }))
      .then((): any => {
        return browser.wait(() => {
          const el = element(by.css('.list-item:nth-child(1) .stop-build'));
          return ExpectedConditions.elementToBeClickable(el);
        });
      })
      .then(() => delay(2000))
      .then((): any => element.all(by.css('.stop-build')).first().click())
      .then((): any => browser.wait(() => {
        return element.all(by.css('.is-running')).count().then(count => count === 0);
      }));
  });

  it('should restart last build', () => {
    return Promise.resolve()
      .then((): any => browser.wait(() => {
        return element.all(by.css('.disabled')).count().then(cnt => cnt === 0);
      }))
      .then((): any => browser.wait(() => {
        return element.all(by.css('.restart-build')).first().isPresent();
      }))
      .then((): any => browser.wait(() => {
        return element.all(by.css('.restart-build')).first().isEnabled();
      }))
      .then(() => delay(2000))
      .then((): any => element.all(by.css('.restart-build')).first().click())
      .then((): any => browser.wait(() => {
        return element.all(by.css('.is-running')).count().then(count => count > 0);
      }))
      .then((): any => browser.wait(() => {
        return element(by.css('.build-time')).isPresent();
      }))
      .then((): any => browser.wait(() => {
        return element.all(by.css('.disabled')).count().then(cnt => cnt === 0);
      }))
      .then((): any => browser.wait(() => {
        return element.all(by.css('.stop-build')).first().isPresent();
      }))
      .then((): any => browser.wait(() => {
        return element.all(by.css('.stop-build')).first().isEnabled();
      }))
      .then((): any => {
        return browser.wait(() => {
          const el = element(by.css('.stop-build'));
          return ExpectedConditions.elementToBeClickable(el);
        });
      })
      .then(() => delay(2000))
      .then((): any => element.all(by.css('.stop-build')).first().click())
      .then((): any => browser.wait(() => {
        return element.all(by.css('.is-running')).count().then(count => count === 0);
      }));
  });
});


text:
/***
* Inferno Engine v4 2015-2017
* Written by Tomasz "Rex Dex" Jonarski
*
* [# filter: frame #]
***/

#pragma once

#include "rendering/runtime/include/renderingFramePayload.h"
#include "rendering/runtime/include/renderingFramePayloadComposer.h"

namespace rendering
{
    namespace scene
    {

        //---

        /// composer for the scene payloads
        class RENDERING_SCENE_API FramePayloadComposer : public runtime::IFramePayloadComposer
        {
            RTTI_DECLARE_VIRTUAL_CLASS(FramePayloadComposer, runtime::IFramePayloadComposer);

        public:
            FramePayloadComposer();
            virtual ~FramePayloadComposer();

            virtual Bool initialize(IDriver* driver) override final;
            virtual void compose(const ImageRenderTargetView& color, const ImageRenderTargetView& depth, const base::math::Rect& area, const runtime::IFramePayload* paload, const runtime::FrameCollectorNode& node) override final;

        private:
            base::SharedPtr<runtime::SurfaceCache> m_surfaceCache;

            IRendererView* createRootView(Renderer* renderer, const runtime::FrameCollectorNode& node, const RenderTargets& renderTargets);
        };

		//---

    } // scene
} // rendering


text:
#define DT_DRV_COMPAT nxp_lpc_gpio

/** @file
 * @brief GPIO driver for LPC54XXX family
 *
 * Note:
 * - fsl_pint internally tries to manage interrupts, but this is not used (e.g.
 *   s_pintCallback), Zephyr's interrupt management system is used in place.
 */

#include <errno.h>
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/irq.h>
#include <soc.h>
#include <fsl_common.h>
#include <zephyr/drivers/gpio/gpio_utils.h>
#include <fsl_gpio.h>
#include <fsl_pint.h>
#include <fsl_inputmux.h>
#include <fsl_device_registers.h>

#define PIN_TO_INPUT_MUX_CONNECTION(port, pin) \
	((PINTSEL_PMUX_ID << PMUX_SHIFT) + (32 * port) + (pin))

#ifndef FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS
#define FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS 0
#endif
#ifndef FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS
#define FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS 0
#endif

#define NO_PINT_INT                                                                                \
	MAX(FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS,                                          \
	    FSL_FEATURE_SECPINT_NUMBER_OF_CONNECTED_OUTPUTS)

struct gpio_mcux_lpc_config {
	/* gpio_driver_config needs to be first */
	struct gpio_driver_config common;
	GPIO_Type *gpio_base;
	PINT_Type *pint_base;
#ifdef IOPCTL
	IOPCTL_Type *pinmux_base;
#else
	IOCON_Type *pinmux_base;
#endif
	uint32_t port_no;
	clock_ip_name_t clock_ip_name;
};

struct gpio_mcux_lpc_data {
	/* gpio_driver_data needs to be first */
	struct gpio_driver_data common;
	/* port ISR callback routine address */
	sys_slist_t callbacks;
	/* pin association with PINT id */
	pint_pin_int_t pint_id[32];
	/* ISR allocated in device tree to this port */
	uint32_t isr_list[INPUTMUX_PINTSEL_COUNT];
	/* index to to table above */
	uint32_t isr_list_idx;
};

static int gpio_mcux_lpc_configure(const struct device *dev, gpio_pin_t pin,
				   gpio_flags_t flags)
{
	const struct gpio_mcux_lpc_config *config = dev->config;
	GPIO_Type *gpio_base = config->gpio_base;
	uint32_t port = config->port_no;

	if (((flags & GPIO_INPUT) != 0) && ((flags & GPIO_OUTPUT) != 0)) {
		return -ENOTSUP;
	}

#ifdef IOPCTL /* RT600 and RT500 series */
	IOPCTL_Type *pinmux_base = config->pinmux_base;
	volatile uint32_t *pinconfig = (volatile uint32_t *)&(pinmux_base->PIO[port][pin]);

	/*
	 * Enable input buffer for both input and output pins, it costs
	 * nothing and allows values to be read back.
	 */
	*pinconfig |= IOPCTL_PIO_INBUF_EN;

	if ((flags & GPIO_SINGLE_ENDED) != 0) {
		*pinconfig |= IOPCTL_PIO_PSEDRAIN_EN;
	} else {
		*pinconfig &= ~IOPCTL_PIO_PSEDRAIN_EN;
	}
	/* Select GPIO mux for this pin (func 0 is always GPIO) */
	*pinconfig &= ~(IOPCTL_PIO_FSEL_MASK);

#else /* LPC SOCs */
	volatile uint32_t *pinconfig;
	IOCON_Type *pinmux_base;

	pinmux_base = config->pinmux_base;
	pinconfig = (volatile uint32_t *)&(pinmux_base->PIO[port][pin]);

	if ((flags & GPIO_SINGLE_ENDED) != 0) {
		/* Set ODE bit. */
		*pinconfig |= IOCON_PIO_OD_MASK;
	}

	if ((flags & GPIO_INPUT) != 0) {
		/* Set DIGIMODE bit */
		*pinconfig |= IOCON_PIO_DIGIMODE_MASK;
	}
	/* Select GPIO mux for this pin (func 0 is always GPIO) */
	*pinconfig &= ~(IOCON_PIO_FUNC_MASK);
#endif

	if (flags & (GPIO_PULL_UP | GPIO_PULL_DOWN)) {
#ifdef IOPCTL /* RT600 and RT500 series */
		*pinconfig |= IOPCTL_PIO_PUPD_EN;
		if ((flags & GPIO_PULL_UP) != 0) {
			*pinconfig |= IOPCTL_PIO_PULLUP_EN;
		} else if ((flags & GPIO_PULL_DOWN) != 0) {
			*pinconfig &= ~(IOPCTL_PIO_PULLUP_EN);
		}
#else /* LPC SOCs */

		*pinconfig &= ~(IOCON_PIO_MODE_PULLUP|IOCON_PIO_MODE_PULLDOWN);
		if ((flags & GPIO_PULL_UP) != 0) {
			*pinconfig |= IOCON_PIO_MODE_PULLUP;
		} else if ((flags & GPIO_PULL_DOWN) != 0) {
			*pinconfig |= IOCON_PIO_MODE_PULLDOWN;
		}
#endif
	}

	/* supports access by pin now,you can add access by port when needed */
	if (flags & GPIO_OUTPUT_INIT_HIGH) {
		gpio_base->SET[port] = BIT(pin);
	}

	if (flags & GPIO_OUTPUT_INIT_LOW) {
		gpio_base->CLR[port] = BIT(pin);
	}

	/* input-0,output-1 */
	WRITE_BIT(gpio_base->DIR[port], pin, flags & GPIO_OUTPUT);

	return 0;
}

static int gpio_mcux_lpc_port_get_raw(const struct device *dev,
				      uint32_t *value)
{
	const struct gpio_mcux_lpc_config *config = dev->config;
	GPIO_Type *gpio_base = config->gpio_base;

	*value = gpio_base->PIN[config->port_no];

	return 0;
}

static int gpio_mcux_lpc_port_set_masked_raw(const struct device *dev,
					     uint32_t mask,
					     uint32_t value)
{
	const struct gpio_mcux_lpc_config *config = dev->config;
	GPIO_Type *gpio_base = config->gpio_base;
	uint32_t port = config->port_no;

	/* Writing 0 allows R+W, 1 disables the pin */
	gpio_base->MASK[port] = ~mask;
	gpio_base->MPIN[port] = value;
	/* Enable back the pins, user won't assume pins remain masked*/
	gpio_base->MASK[port] = 0U;

	return 0;
}

static int gpio_mcux_lpc_port_set_bits_raw(const struct device *dev,
					   uint32_t mask)
{
	const struct gpio_mcux_lpc_config *config = dev->config;
	GPIO_Type *gpio_base = config->gpio_base;

	gpio_base->SET[config->port_no] = mask;

	return 0;
}

static int gpio_mcux_lpc_port_clear_bits_raw(const struct device *dev,
					     uint32_t mask)
{
	const struct gpio_mcux_lpc_config *config = dev->config;
	GPIO_Type *gpio_base = config->gpio_base;

	gpio_base->CLR[config->port_no] = mask;

	return 0;
}

static int gpio_mcux_lpc_port_toggle_bits(const struct device *dev,
					  uint32_t mask)
{
	const struct gpio_mcux_lpc_config *config = dev->config;
	GPIO_Type *gpio_base = config->gpio_base;

	gpio_base->NOT[config->port_no] = mask;

	return 0;
}

static void gpio_mcux_lpc_port_isr(const struct device *dev)
{
	const struct gpio_mcux_lpc_config *config = dev->config;
	struct gpio_mcux_lpc_data *data = dev->data;
	uint32_t enabled_int;
	uint32_t int_flags;
	uint32_t pin;

	for (pin = 0; pin < 32; pin++) {
		if (data->pint_id[pin] != NO_PINT_INT) {
			int_flags = PINT_PinInterruptGetStatus(
				config->pint_base, data->pint_id[pin]);
			enabled_int = int_flags << pin;

			if (int_flags) {
				PINT_PinInterruptClrStatus(config->pint_base,
							   data->pint_id[pin]);
			}

			gpio_fire_callbacks(&data->callbacks, dev, enabled_int);
		}
	}
}

static uint32_t get_free_isr(struct gpio_mcux_lpc_data *data)
{
	uint32_t i;
	uint32_t isr;

	for (i = 0; i < data->isr_list_idx; i++) {
		if (data->isr_list[i] != -1) {
			isr = data->isr_list[i];
			data->isr_list[i] = -1;
			return isr;
		}
	}

	return -EINVAL;
}

/* Function configures INPUTMUX device to route pin interrupts to a certain
 * PINT. PINT no. is unknown, rather it's determined from ISR no.
 */
static uint32_t attach_pin_to_isr(uint32_t port, uint32_t pin, uint32_t isr_no)
{
	uint32_t pint_idx;
	/* Connect trigger sources to PINT */
	INPUTMUX_Init(INPUTMUX);

	/* Code asumes PIN_INT values are grouped [0..3] and [4..7].
	 * This scenario is true in LPC54xxx/LPC55xxx.
	 */
#if (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 8)
	#error having more than 8 PINT IRQs not supported in driver
#elif (FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS > 4)
	if (isr_no < PIN_INT4_IRQn) {
		pint_idx = isr_no - PIN_INT0_IRQn;
	} else {
		pint_idx = isr_no - PIN_INT4_IRQn + 4;
	}
#else
	pint_idx = isr_no - PIN_INT0_IRQn;
#endif

	INPUTMUX_AttachSignal(INPUTMUX, pint_idx,
			      PIN_TO_INPUT_MUX_CONNECTION(port, pin));

	/* Turnoff clock to inputmux to save power. Clock is only needed to make
	 * changes. Can be turned off after.
	 */
	INPUTMUX_Deinit(INPUTMUX);

	return pint_idx;
}

static void gpio_mcux_lpc_port_isr(const struct device *dev);

static int gpio_mcux_lpc_pin_interrupt_configure(const struct device *dev,
						 gpio_pin_t pin,
						 enum gpio_int_mode mode,
						 enum gpio_int_trig trig)
{
	const struct gpio_mcux_lpc_config *config = dev->config;
	struct gpio_mcux_lpc_data *data = dev->data;
	pint_pin_enable_t interruptMode = kPINT_PinIntEnableNone;
	GPIO_Type *gpio_base = config->gpio_base;
	uint32_t port = config->port_no;
	uint32_t isr;
	uint32_t pint_idx;
	static bool pint_inited;

	/* Ensure pin used as interrupt is set as input*/
	if ((mode & GPIO_INT_ENABLE) &&
		((gpio_base->DIR[port] & BIT(pin)) != 0)) {
		return -ENOTSUP;
	}

	switch (mode) {
	case GPIO_INT_MODE_DISABLED:
		interruptMode = kPINT_PinIntEnableNone;
		break;
	case GPIO_INT_MODE_LEVEL:
		if (trig == GPIO_INT_TRIG_HIGH) {
			interruptMode = kPINT_PinIntEnableHighLevel;
		} else if (trig == GPIO_INT_TRIG_LOW) {
			interruptMode = kPINT_PinIntEnableLowLevel;
		} else {
			return -ENOTSUP;
		}
		break;
	case GPIO_INT_MODE_EDGE:
		if (trig == GPIO_INT_TRIG_HIGH) {
			interruptMode = kPINT_PinIntEnableRiseEdge;
		} else if (trig == GPIO_INT_TRIG_LOW) {
			interruptMode = kPINT_PinIntEnableFallEdge;
		} else {
			interruptMode = kPINT_PinIntEnableBothEdges;
		}
		break;
	default:
		return -ENOTSUP;
	}

	/* First time calling this function routes PIN->PINT->INPUTMUX->NVIC */
	if (data->pint_id[pin] == NO_PINT_INT) {
		isr = get_free_isr(data);
		if (isr == -EINVAL) {
			/* Didn't find any free interrupt in this port */
			return -EBUSY;
		}
		pint_idx = attach_pin_to_isr(port, pin, isr);
		data->pint_id[pin] = pint_idx;
	}

	if (!pint_inited) {
		PINT_Init(config->pint_base);
		pint_inited = true;
	}
	PINT_PinInterruptConfig(config->pint_base, data->pint_id[pin],
		interruptMode,
		(pint_cb_t)gpio_mcux_lpc_port_isr);

	return 0;
}

static int gpio_mcux_lpc_manage_cb(const struct device *port,
				   struct gpio_callback *callback, bool set)
{
	struct gpio_mcux_lpc_data *data = port->data;

	return gpio_manage_callback(&data->callbacks, callback, set);
}

static int gpio_mcux_lpc_init(const struct device *dev)
{
	const struct gpio_mcux_lpc_config *config = dev->config;
	struct gpio_mcux_lpc_data *data = dev->data;
	int i;

	GPIO_PortInit(config->gpio_base, config->port_no);

	for (i = 0; i < 32; i++) {
		data->pint_id[i] = NO_PINT_INT;
	}

	data->isr_list_idx = 0;

	return 0;
}

static const struct gpio_driver_api gpio_mcux_lpc_driver_api = {
	.pin_configure = gpio_mcux_lpc_configure,
	.port_get_raw = gpio_mcux_lpc_port_get_raw,
	.port_set_masked_raw = gpio_mcux_lpc_port_set_masked_raw,
	.port_set_bits_raw = gpio_mcux_lpc_port_set_bits_raw,
	.port_clear_bits_raw = gpio_mcux_lpc_port_clear_bits_raw,
	.port_toggle_bits = gpio_mcux_lpc_port_toggle_bits,
	.pin_interrupt_configure = gpio_mcux_lpc_pin_interrupt_configure,
	.manage_callback = gpio_mcux_lpc_manage_cb,
};

static const clock_ip_name_t gpio_clock_names[] = GPIO_CLOCKS;

#ifdef IOPCTL
#define PINMUX_BASE	IOPCTL
#else
#define PINMUX_BASE	IOCON
#endif

#define GPIO_MCUX_LPC_IRQ_CONNECT(n, m)							\
	do {										\
		struct gpio_mcux_lpc_data *data = dev->data;				\
		IRQ_CONNECT(DT_INST_IRQ_BY_IDX(n, m, irq),				\
			    DT_INST_IRQ_BY_IDX(n, m, priority),				\
			    gpio_mcux_lpc_port_isr, DEVICE_DT_INST_GET(n), 0);		\
		irq_enable(DT_INST_IRQ_BY_IDX(n, m, irq));				\
		data->isr_list[data->isr_list_idx++] = DT_INST_IRQ_BY_IDX(n, m, irq);	\
	} while (false)

#define GPIO_MCUX_LPC_IRQ(idx, inst)							\
	COND_CODE_1(DT_INST_IRQ_HAS_IDX(inst, idx),					\
		(GPIO_MCUX_LPC_IRQ_CONNECT(inst, idx)), ())

#define GPIO_MCUX_LPC(n)								\
	static int lpc_gpio_init_##n(const struct device *dev);				\
											\
	static const struct gpio_mcux_lpc_config gpio_mcux_lpc_config_##n = {		\
		.common = {								\
			.port_pin_mask = GPIO_PORT_PIN_MASK_FROM_DT_INST(n),		\
		},									\
		.gpio_base = GPIO,							\
		.pint_base = PINT, /* TODO: SECPINT issue #16330 */			\
		.pinmux_base = PINMUX_BASE,						\
		.port_no = DT_INST_PROP(n, port),					\
		.clock_ip_name = gpio_clock_names[DT_INST_PROP(n, port)],		\
	};										\
											\
	static struct gpio_mcux_lpc_data gpio_mcux_lpc_data_##n;			\
											\
	DEVICE_DT_INST_DEFINE(n, lpc_gpio_init_##n, NULL,				\
		    &gpio_mcux_lpc_data_##n,						\
		    &gpio_mcux_lpc_config_##n, PRE_KERNEL_1,				\
		    CONFIG_GPIO_INIT_PRIORITY,						\
		    &gpio_mcux_lpc_driver_api);						\
											\
	static int lpc_gpio_init_##n(const struct device *dev)				\
	{										\
		gpio_mcux_lpc_init(dev);						\
											\
		LISTIFY(8, GPIO_MCUX_LPC_IRQ, (;), n)					\
											\
		return 0;								\
	}

DT_INST_FOREACH_STATUS_OKAY(GPIO_MCUX_LPC)


text:
#pragma once
#include <aws/nimble/NimbleStudio_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/nimble/model/StreamingImageEncryptionConfigurationKeyType.h>
#include <utility>

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

  /**
   *
Specifies how a streaming image is encrypted.

See Also:
   AWS
   * API Reference

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

    /**
     *
The ARN for a KMS key that is used to encrypt studio data.

     */
    inline const Aws::String& GetKeyArn() const{ return m_keyArn; }

    /**
     *
The ARN for a KMS key that is used to encrypt studio data.

     */
    inline bool KeyArnHasBeenSet() const { return m_keyArnHasBeenSet; }

    /**
     *
The ARN for a KMS key that is used to encrypt studio data.

     */
    inline void SetKeyArn(const Aws::String& value) { m_keyArnHasBeenSet = true; m_keyArn = value; }

    /**
     *
The ARN for a KMS key that is used to encrypt studio data.

     */
    inline void SetKeyArn(Aws::String&& value) { m_keyArnHasBeenSet = true; m_keyArn = std::move(value); }

    /**
     *
The ARN for a KMS key that is used to encrypt studio data.

     */
    inline void SetKeyArn(const char* value) { m_keyArnHasBeenSet = true; m_keyArn.assign(value); }

    /**
     *
The ARN for a KMS key that is used to encrypt studio data.

     */
    inline StreamingImageEncryptionConfiguration& WithKeyArn(const Aws::String& value) { SetKeyArn(value); return *this;}

    /**
     *
The ARN for a KMS key that is used to encrypt studio data.

     */
    inline StreamingImageEncryptionConfiguration& WithKeyArn(Aws::String&& value) { SetKeyArn(std::move(value)); return *this;}

    /**
     *
The ARN for a KMS key that is used to encrypt studio data.

     */
    inline StreamingImageEncryptionConfiguration& WithKeyArn(const char* value) { SetKeyArn(value); return *this;}

    /**
     *
The type of KMS key that is used to encrypt studio data.

     */
    inline const StreamingImageEncryptionConfigurationKeyType& GetKeyType() const{ return m_keyType; }

    /**
     *
The type of KMS key that is used to encrypt studio data.

     */
    inline bool KeyTypeHasBeenSet() const { return m_keyTypeHasBeenSet; }

    /**
     *
The type of KMS key that is used to encrypt studio data.

     */
    inline void SetKeyType(const StreamingImageEncryptionConfigurationKeyType& value) { m_keyTypeHasBeenSet = true; m_keyType = value; }

    /**
     *
The type of KMS key that is used to encrypt studio data.

     */
    inline void SetKeyType(StreamingImageEncryptionConfigurationKeyType&& value) { m_keyTypeHasBeenSet = true; m_keyType = std::move(value); }

    /**
     *
The type of KMS key that is used to encrypt studio data.

     */
    inline StreamingImageEncryptionConfiguration& WithKeyType(const StreamingImageEncryptionConfigurationKeyType& value) { SetKeyType(value); return *this;}

    /**
     *
The type of KMS key that is used to encrypt studio data.

     */
    inline StreamingImageEncryptionConfiguration& WithKeyType(StreamingImageEncryptionConfigurationKeyType&& value) { SetKeyType(std::move(value)); return *this;}

  private:

    Aws::String m_keyArn;
    bool m_keyArnHasBeenSet;

    StreamingImageEncryptionConfigurationKeyType m_keyType;
    bool m_keyTypeHasBeenSet;
  };

} // namespace Model
} // namespace NimbleStudio
} // namespace Aws


text:
package com.hazelcast.spring.replicatedmap;

import com.hazelcast.config.InMemoryFormat;
import com.hazelcast.config.ListenerConfig;
import com.hazelcast.config.ReplicatedMapConfig;
import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.spring.CustomSpringJUnit4ClassRunner;
import com.hazelcast.test.annotation.QuickTest;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;

import javax.annotation.Resource;
import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

@RunWith(CustomSpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"replicatedMap-applicationContext-hazelcast.xml"})
@Category(QuickTest.class)
public class TestReplicatedMapApplicationContext {

    @Resource(name = "instance")
    private HazelcastInstance instance;

    @BeforeClass
    @AfterClass
    public static void start() {
        Hazelcast.shutdownAll();
    }

    @Test
    public void testReplicatedMapConfig() {
        ReplicatedMapConfig replicatedMapConfig = instance.getConfig().getReplicatedMapConfig("replicatedMap");
        assertNotNull(replicatedMapConfig);
        assertEquals(3, replicatedMapConfig.getConcurrencyLevel());
        assertEquals("OBJECT", InMemoryFormat.OBJECT.name());
        assertTrue(replicatedMapConfig.isAsyncFillup());
        assertFalse(replicatedMapConfig.isStatisticsEnabled());
        assertEquals(10, replicatedMapConfig.getReplicationDelayMillis());

        List<ListenerConfig> listenerConfigs = replicatedMapConfig.getListenerConfigs();
        assertEquals(1, listenerConfigs.size());
        assertEquals("com.hazelcast.spring.DummyEntryListener", listenerConfigs.get(0).getClassName());
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
OldComplexFileTable (POI API Documentation)
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.apache.poi.hwpf.model

Class OldComplexFileTable

java.lang.Object
  org.apache.poi.hwpf.model.ComplexFileTable
      org.apache.poi.hwpf.model.OldComplexFileTable

@Internal
public final class OldComplexFileTable
extends ComplexFileTable

Field Summary

Fields inherited from class org.apache.poi.hwpf.model.ComplexFileTable

_tpt

Constructor Summary

OldComplexFileTable(byte[] documentStream,
                    byte[] tableStream,
                    int offset,
                    int fcMin,
                    java.nio.charset.Charset charset)

Method Summary

protected  TextPieceTable
newTextPieceTable(byte[] documentStream,
                  byte[] tableStream,
                  int offset,
                  int pieceTableSize,
                  int fcMin,
                  java.nio.charset.Charset charset)

Methods inherited from class org.apache.poi.hwpf.model.ComplexFileTable

getGrpprls, getTextPieceTable, writeTo, writeTo

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OldComplexFileTable

public OldComplexFileTable(byte[] documentStream,
                           byte[] tableStream,
                           int offset,
                           int fcMin,
                           java.nio.charset.Charset charset)
                    throws java.io.IOException

Throws:

java.io.IOException

Method Detail

newTextPieceTable

protected TextPieceTable newTextPieceTable(byte[] documentStream,
                                           byte[] tableStream,
                                           int offset,
                                           int pieceTableSize,
                                           int fcMin,
                                           java.nio.charset.Charset charset)

Overrides:
newTextPieceTable in class ComplexFileTable

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

                Copyright 2017 The Apache Software Foundation or
        its licensors, as applicable.


text:
package org.pxcbpmisframework.core.common.hibernate.qbc;

/**
 * @author panxiaochao
 * @date: 日期:2013.06.09
 */
public class SqlQuery implements Query {
	/**
	 * hql:select * from entityname
	 *
	 * @param entityname
	 * @return
	 */
	public String getSQLList(String entityname) {
		return TBSELECT + "*" + TBFROM + entityname;
	}

}


text:
from openerp.osv import fields,osv

class ir_exports(osv.osv):
    _name = "ir.exports"
    _order = 'name'
    _columns = {
        'name': fields.char('Export Name', size=128),
        'resource': fields.char('Resource', size=128, select=True),
        'export_fields': fields.one2many('ir.exports.line', 'export_id',
                                         'Export ID'),
    }
ir_exports()

class ir_exports_line(osv.osv):
    _name = 'ir.exports.line'
    _order = 'id'
    _columns = {
        'name': fields.char('Field Name', size=64),
        'export_id': fields.many2one('ir.exports', 'Export', select=True, ondelete='cascade'),
    }
ir_exports_line()

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:


text:
(function(){
  'use strict';

  // Prepare the 'users' module for subsequent registration of controllers and delegates
  angular.module('users', [ 'ngMaterial', 'timer', 'weatherModule' ])
  .config( function( $mdIconProvider ){
    $mdIconProvider.iconSet("avatar", 'assets/svg/avatars.svg', 128);
  })
      .config(function($sceProvider) {
          // Completely disable SCE.  For demonstration purposes only!
          // Do not use in new projects.
          $sceProvider.enabled(false);
      })
      .directive('weather', weatherDirective);

  function weatherDirective() {
    return {
      restrict: 'AE',
      repalce: true,
      link: function(){

      }
    }
  }

})();


text:
#import "SNBStateSaverConsoleOperation.h"
#import "asl.h"

static NSDateFormatter *dateFormatter;

static NSString *kConsoleTimeKey = @"Time";
static NSString *kConsoleMessageKey = @"Message";

@interface SNBStateSaverConsoleOperation()

@property (nonatomic, assign) BOOL isExecuting;
@property (nonatomic, assign) BOOL isFinished;

@property (nonatomic, strong) NSString *path;

@property (nonatomic, assign) BOOL success;

@end

@implementation SNBStateSaverConsoleOperation

- (instancetype)initWithPath:(NSString *)path
{
    self = [super init];
    if(self) {
        self.path = path;

        if (!dateFormatter) {
            dateFormatter = [[NSDateFormatter alloc] init];
            [dateFormatter setDateFormat:@"M/d/yyyy h:mma"];
        }
    }
    return self;
}

- (void)start
{
    NSString *consoleLog = [self fetchConsole];
    BOOL success = [consoleLog writeToFile:[self.path stringByAppendingPathComponent:@"console.log"] atomically:YES encoding:NSUTF8StringEncoding error:NULL];
    self.success = success;
}

- (NSString *)fetchConsole
{
    NSMutableString *response = nil;
    NSString *appName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"];

    if(appName) {

        response = [[NSMutableString alloc] init];
        aslmsg q = asl_new(ASL_TYPE_QUERY);

        if(q) {
            uint32_t senderQueryOptions = ASL_QUERY_OP_EQUAL | ASL_QUERY_OP_CASEFOLD|ASL_QUERY_OP_SUBSTRING;
            asl_set_query(q, ASL_KEY_SENDER, [appName UTF8String], senderQueryOptions);

            aslresponse r = asl_search(NULL, q);
            if(r) {

                aslmsg m;
                int i;
                const char *key, *val;

                while (NULL != (m = aslresponse_next(r))) {

                    NSMutableDictionary *responseDict = [[NSMutableDictionary alloc] init];
                    for (i = 0; (NULL != (key = asl_key(m, i))); i++)
                    {
                        NSString *keyString = nil;
                        if(key) {
                            keyString = [NSString stringWithUTF8String:(char *) key];
                            val = asl_get(m, key);

                            NSString *string = val ? [NSString stringWithUTF8String:val] : @"";
                            [responseDict setObject:string forKey:keyString];
                        }
                    }

                    if(responseDict[kConsoleTimeKey] && responseDict[kConsoleMessageKey]) {

                        NSTimeInterval interval = [responseDict[kConsoleTimeKey] doubleValue];
                        NSDate *timeStamp = [[NSDate alloc] initWithTimeIntervalSince1970: interval];
                        NSString *dateText = [dateFormatter stringFromDate:timeStamp];

                        NSString *consoleLine = [NSString stringWithFormat:@"%@: %@\n", dateText, responseDict[kConsoleMessageKey]];
                        [response appendString:consoleLine];
                    }
                }
            }

            aslresponse_free(r);
        }
    }

    return response;
}

@end


text:
module Stradivari
  module CSV
    class Generator < Stradivari::Table::Generator

      class Column < Table::Generator::Column
        def to_s object
          if @renderer.present?
            capture_haml { view.instance_exec(object, &@renderer) }
          else
            build(object)
          end.to_s.strip
        end
      end

      def to_s
        renderer = lambda { render_csv_content }

        capture_haml(&renderer)
      end

      protected

        def render_csv_content
          ::CSV.generate do |csv|
            csv << render_file_header

            @data.each do |object|
              csv << render_file_row(object)

              if children = self.children(object)
                children.each do |child|
                  csv << render_file_row(child)
                end
              end
            end
          end
        end

        def render_file_header
          @columns.map(&:title)
        end

        def render_file_row object
          @columns.map{ |col| col.to_s(object) }
        end

    end
  end
end


text:
.class public final Lcom/fasterxml/jackson/databind/node/NodeCursor$Object;
.super Lcom/fasterxml/jackson/databind/node/NodeCursor;
.source ""

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/fasterxml/jackson/databind/node/NodeCursor;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x19
    name = "Object"
.end annotation

# instance fields
.field protected _contents:Ljava/util/Iterator;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Iterator<Ljava/util/Map$Entry<Ljava/lang/String;Lcom/fasterxml/jackson/databind/JsonNode;>;>;"
        }
    .end annotation
.end field

.field protected _current:Ljava/util/Map$Entry;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map$Entry<Ljava/lang/String;Lcom/fasterxml/jackson/databind/JsonNode;>;"
        }
    .end annotation
.end field

.field protected _needEntry:Z

# direct methods
.method public constructor <init>(Lcom/fasterxml/jackson/databind/JsonNode;Lcom/fasterxml/jackson/databind/node/NodeCursor;)V
    .locals 1

    .line 187
    const/4 v0, 0x2

    invoke-direct {p0, v0, p2}, Lcom/fasterxml/jackson/databind/node/NodeCursor;-><init>(ILcom/fasterxml/jackson/databind/node/NodeCursor;)V

    .line 188
    move-object v0, p1

    check-cast v0, Lcom/fasterxml/jackson/databind/node/ObjectNode;

    invoke-virtual {v0}, Lcom/fasterxml/jackson/databind/node/ObjectNode;->fields()Ljava/util/Iterator;

    move-result-object v0

    iput-object v0, p0, Lcom/fasterxml/jackson/databind/node/NodeCursor$Object;->_contents:Ljava/util/Iterator;

    .line 189
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/fasterxml/jackson/databind/node/NodeCursor$Object;->_needEntry:Z

    .line 190
    return-void
.end method

# virtual methods
.method public final currentHasChildren()Z
    .locals 1

    .line 231
    invoke-virtual {p0}, Lcom/fasterxml/jackson/databind/node/NodeCursor$Object;->currentNode()Lcom/fasterxml/jackson/databind/JsonNode;

    move-result-object v0

    check-cast v0, Lcom/fasterxml/jackson/databind/node/ContainerNode;

    invoke-virtual {v0}, Lcom/fasterxml/jackson/databind/node/ContainerNode;->size()I

    move-result v0

    if-lez v0, :cond_0

    const/4 v0, 0x1

    return v0

    :cond_0
    const/4 v0, 0x0

    return v0
.end method

.method public final currentNode()Lcom/fasterxml/jackson/databind/JsonNode;
    .locals 1

    .line 226
    iget-object v0, p0, Lcom/fasterxml/jackson/databind/node/NodeCursor$Object;->_current:Ljava/util/Map$Entry;

    if-nez v0, :cond_0

    const/4 v0, 0x0

    return-object v0

    :cond_0
    iget-object v0, p0, Lcom/fasterxml/jackson/databind/node/NodeCursor$Object;->_current:Ljava/util/Map$Entry;

    invoke-interface {v0}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/fasterxml/jackson/databind/JsonNode;

    return-object v0
.end method

.method public final endToken()Lcom/fasterxml/jackson/core/JsonToken;
    .locals 1

    .line 222
    sget-object v0, Lcom/fasterxml/jackson/core/JsonToken;->END_OBJECT:Lcom/fasterxml/jackson/core/JsonToken;

    return-object v0
.end method

.method public final bridge synthetic getParent()Lcom/fasterxml/jackson/core/JsonStreamContext;
    .locals 1

    .line 177
    invoke-super {p0}, Lcom/fasterxml/jackson/databind/node/NodeCursor;->getParent()Lcom/fasterxml/jackson/databind/node/NodeCursor;

    move-result-object v0

    return-object v0
.end method

.method public final nextToken()Lcom/fasterxml/jackson/core/JsonToken;
    .locals 1

    .line 196
    iget-boolean v0, p0, Lcom/fasterxml/jackson/databind/node/NodeCursor$Object;->_needEntry:Z

    if-eqz v0, :cond_2

    .line 197
    iget-object v0, p0, Lcom/fasterxml/jackson/databind/node/NodeCursor$Object;->_contents:Ljava/util/Iterator;

    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-nez v0, :cond_0

    .line 198
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/fasterxml/jackson/databind/node/NodeCursor$Object;->_currentName:Ljava/lang/String;

    .line 199
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/fasterxml/jackson/databind/node/NodeCursor$Object;->_current:Ljava/util/Map$Entry;

    .line 200
    const/4 v0, 0x0

    return-object v0

    .line 202
    :cond_0
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/fasterxml/jackson/databind/node/NodeCursor$Object;->_needEntry:Z

    .line 203
    iget-object v0, p0, Lcom/fasterxml/jackson/databind/node/NodeCursor$Object;->_contents:Ljava/util/Iterator;

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/Map$Entry;

    iput-object v0, p0, Lcom/fasterxml/jackson/databind/node/NodeCursor$Object;->_current:Ljava/util/Map$Entry;

    .line 204
    iget-object v0, p0, Lcom/fasterxml/jackson/databind/node/NodeCursor$Object;->_current:Ljava/util/Map$Entry;

    if-nez v0, :cond_1

    const/4 v0, 0x0

    goto :goto_0

    :cond_1
    iget-object v0, p0, Lcom/fasterxml/jackson/databind/node/NodeCursor$Object;->_current:Ljava/util/Map$Entry;

    invoke-interface {v0}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    :goto_0
    iput-object v0, p0, Lcom/fasterxml/jackson/databind/node/NodeCursor$Object;->_currentName:Ljava/lang/String;

    .line 205
    sget-object v0, Lcom/fasterxml/jackson/core/JsonToken;->FIELD_NAME:Lcom/fasterxml/jackson/core/JsonToken;

    return-object v0

    .line 207
    :cond_2
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/fasterxml/jackson/databind/node/NodeCursor$Object;->_needEntry:Z

    .line 208
    iget-object v0, p0, Lcom/fasterxml/jackson/databind/node/NodeCursor$Object;->_current:Ljava/util/Map$Entry;

    invoke-interface {v0}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/fasterxml/jackson/databind/JsonNode;

    invoke-virtual {v0}, Lcom/fasterxml/jackson/databind/JsonNode;->asToken()Lcom/fasterxml/jackson/core/JsonToken;

    move-result-object v0

    return-object v0
.end method

.method public final nextValue()Lcom/fasterxml/jackson/core/JsonToken;
    .locals 3

    .line 214
    invoke-virtual {p0}, Lcom/fasterxml/jackson/databind/node/NodeCursor$Object;->nextToken()Lcom/fasterxml/jackson/core/JsonToken;

    move-result-object v0

    .line 215
    move-object v2, v0

    sget-object v1, Lcom/fasterxml/jackson/core/JsonToken;->FIELD_NAME:Lcom/fasterxml/jackson/core/JsonToken;

    if-ne v0, v1, :cond_0

    .line 216
    invoke-virtual {p0}, Lcom/fasterxml/jackson/databind/node/NodeCursor$Object;->nextToken()Lcom/fasterxml/jackson/core/JsonToken;

    move-result-object v2

    .line 218
    :cond_0
    return-object v2
.end method


text:
<?PHP
/**
 * 列出磁盘
 *
 * https://msdn.microsoft.com/zh-cn/library/azure/jj157176.aspx
 */
require 'common.php';

use WindowsAzure\Common\ServicesBuilder;
use WindowsAzure\Common\ServiceException;

try {
    $serviceManagementRestProxy = ServicesBuilder::getInstance()->createServiceManagementService($conn_string);

    $result = $serviceManagementRestProxy->listDisks();
    print_r($result);
} catch (ServiceException $e) {
    // Handle exception based on error codes and messages.
    // Error codes and messages are here:
    // http://msdn.microsoft.com/en-us/library/windowsazure/ee460801
    echo $e->getMessage();
}


text:
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Especialidad;

class EspecialidadController extends Controller
{

    /**
     * Muestra la especialidad y los medicos que son de esta.
     *
     * @param  int  $especialidad_id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        $especialidad = Especialidad::findOrFail($id);
        $medicos = $especialidad->medicos;

        return view('pages.especialidad')->with('medicos', $medicos)->with('especialidad', $especialidad);
    }

}


text:
@interface ChildVCOne () <UITableViewDataSource, UITableViewDelegate>
@property (nonatomic, strong) UITableView *tableView;

@end

@implementation ChildVCOne

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    NSLog(@"ChildVCOne - - viewWillAppear");
}

- (void)viewDidLayoutSubviews {
    [super viewDidLayoutSubviews];

    // 切记:纯代码在 viewDidLoad 方法中创建 tableView 时,高度一定要等于 PageContent 的高度 self.view.frame.size.height - 108 或 使用 Masonry 进行 下面一句代码的约束;
    //    [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
    //        make.edges.equalTo(self.view);
    //    }];

    // XIB 创建 tableView 时,不会出现这种问题,是因为 XIB 加载完成之后会调用 viewDidLayoutSubviews 这个方法,所以 XIB 中创建 tableVIew 不会出现约束问题

    /// 解决方案三
    [self.view addSubview:self.tableView];
}

- (UITableView *)tableView {
    if (!_tableView) {
        _tableView = [[UITableView alloc] initWithFrame:self.view.frame style:UITableViewStylePlain];
        _tableView.dataSource = self;
        _tableView.delegate = self;
    }
    return _tableView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    NSLog(@"ChildVCOne - - viewDidLoad");

    /// 解决方案一
//    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height - 108) style:UITableViewStylePlain];
//    _tableView.dataSource = self;
//    [self.view addSubview:self.tableView];

    /// 解决方案二
//    self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
//    _tableView.dataSource = self;
//    [self.view addSubview:self.tableView];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 25;
};

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cell"];
    }
    cell.textLabel.text = [NSString stringWithFormat:@"SGPagingView - ChildVCOne - - %ld", (long)indexPath.row];
    return cell;
}

@end


text:
app.controller("WindowController", function($scope, $rootScope, $localStorage, FeedService, Gw2Service) {
    $scope.loadingDialog = query("#game-starting-dialog");
    $scope.editAccountDialog = query("#edit-account-dialog");
    $scope.addAccountDialog = query("#add-account-dialog");
    $scope.askEncryptionDialog = query("#ask-encryption-dialog");
    $scope.enterEncryptionDialog = query("#enter-encryption-dialog");
    $scope.decryptDialog = query("#decrypt-dialog");
    $scope.settingsDialog = query("#settings-dialog");
    $scope.aboutDialog = query("#about-dialog");

    $scope.accounts = [];

    $scope.gameRunning = false;
    $scope.showContentOverlay = true;

    if($localStorage.accounts && $localStorage.accounts.length > 0) {
        $scope.accounts = $localStorage.accounts;
    }

    $rootScope.$on("master-password-set", function() {
        $scope.checkForNewBuild();

        $scope.showContentOverlay = false;

        $scope.registerUpdateCallback(function() {
            if(!$scope.gameRunning) {
                $scope.checkForNewBuild();
            }
        });
    });

    $scope.closeWindow = function() {
        window.close();
    };

    $scope.showDialog = function(dialog, status) {
        if(status) {
            dialog.showModal();
        } else {
            dialog.close();
        }
    }

    $scope.updateGameClient = function() {
        $scope.loadingDialog.showModal();

        var params = ["-image"];

        if($scope.os().osx) {
            var ciderParams = ["-use-dos-cwd", "\"C:\\Gw2\"", "--", "\"C:\\GW2\\GW2.exe\""];

            params = ciderParams.concat(params);
        }

        var game = spawn($rootScope.executable(), params);

        game.on("exit", function(code, signal) {
            $scope.loadingDialog.close();
        });
    };

    $scope.startClassicLauncher = function() {
        $scope.loadingDialog.showModal();

        var game = spawn($rootScope.executable());

        game.on("exit", function(code, signal) {
            $scope.loadingDialog.close();
        });
    }

    $scope.checkForNewBuild = function() {
        // check last known build number with the current one from the server, if they don't match
        // start update
        Gw2Service.getBuildNumber().then(function(res) {
            var lastBuildNumber = $localStorage.buildNumber;
            $localStorage.buildNumber = res.data.id;

            if(lastBuildNumber != undefined) {
                if(lastBuildNumber != res.data.id) {
                    juicy.log("Current build: " + lastBuildNumber + ", but server claims to have a new one ready: " +
                        res.data.id + "... trying to update...");

                    if($scope.configs().autoUpdates) {
                        $scope.updateGameClient();
                    }
                }
            }
        });
    };

    $scope.login = function(email, password, parametersString) {
        if(!parametersString) {
            parametersString = "";
        }

        var parameters = parametersString.split(" ");

        var launchParams = [
            "-email", "\"" + email + "\"",
            "-password", "\"" + $scope.decrypt(password) + "\"",
            "-nopatchui"
        ];

        if($scope.os().osx) {
            var ciderParams = ["-use-dos-cwd", "\"C:\\Gw2\"", "--", "\"C:\\GW2\\GW2.exe\""];

            launchParams = ciderParams.concat(launchParams);
        }

        launchParams = launchParams.concat(parameters);

        var launch = "\"" + $rootScope.executable() + "\" " + launchParams.join(" ");

        $scope.gameRunning = true;
        $scope.loadingDialog.showModal();

        // close dialog again after 15s
        setTimeout(function() {
            $scope.loadingDialog.close();
        }, 15 * 1000);

        var game = exec(launch);

        game.stdout.on("data", function(data) {
            juicy.log(data.toString());
        });

        game.stderr.on("data", function(data) {
            juicy.error(data.toString());
        });

        game.on("exit", function(code, signal) {
            $scope.gameRunning = false;
            $scope.checkForNewBuild();
        });
    };

    $scope.pad = function(number) {
        if(number < 10) {
            return "0" + number;
        }

        return "" + number;
    };
});


text:
class Browser;
class Profile;

namespace content {
class WebContents;
}

namespace views {
class StyledLabel;
}

// A tab-modal dialog to allow a user signing in with a managed account
// to create a new Chrome profile.
class ProfileSigninConfirmationDialogViews : public views::DialogDelegateView,
                                             public views::LinkListener,
                                             public views::StyledLabelListener {
 public:
  // Create and show the dialog, which owns itself.
  static void ShowDialog(Browser* browser,
                         Profile* profile,
                         const std::string& username,
                         ui::ProfileSigninConfirmationDelegate* delegate);

 private:
  ProfileSigninConfirmationDialogViews(
      Browser* browser,
      Profile* profile,
      const std::string& username,
      ui::ProfileSigninConfirmationDelegate* delegate);
  virtual ~ProfileSigninConfirmationDialogViews();

  // views::DialogDelegateView:
  virtual string16 GetWindowTitle() const OVERRIDE;
  virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE;
  virtual int GetDefaultDialogButton() const OVERRIDE;
  virtual views::View* CreateExtraView() OVERRIDE;
  virtual bool Accept() OVERRIDE;
  virtual bool Cancel() OVERRIDE;
  virtual void OnClose() OVERRIDE;
  virtual ui::ModalType GetModalType() const OVERRIDE;
  virtual void ViewHierarchyChanged(
      const ViewHierarchyChangedDetails& details) OVERRIDE;

  // views::LinkListener:
  virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE;

  // views::StyledLabelListener:
  virtual void StyledLabelLinkClicked(const ui::Range& range,
                                      int event_flags) OVERRIDE;

  // Shows the dialog and releases ownership of this object. It will
  // delete itself when the dialog is closed. If |prompt_for_new_profile|
  // is true, the dialog will offer to create a new profile before signin.
  void Show(bool prompt_for_new_profile);

  // Weak ptr to label for dialog explanation text.
  views::StyledLabel* explanation_label_;

  // Weak ptr to parent view.
  Browser* browser_;

  // The profile being signed in.
  Profile* profile_;

  // The GAIA username being signed in.
  std::string username_;

  // Dialog button handler.
  ui::ProfileSigninConfirmationDelegate* delegate_;

  // Whether the user should be prompted to create a new profile.
  bool prompt_for_new_profile_;

  // The link to create a new profile.
  views::Link* link_;

  DISALLOW_COPY_AND_ASSIGN(ProfileSigninConfirmationDialogViews);
};

#endif  // CHROME_BROWSER_UI_VIEWS_SYNC_PROFILE_SIGNIN_CONFIRMATION_DIALOG_VIEWS_H_