text:
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title>Ubuntu security notices</title>
    <link>https://ubuntu.com/security/notices/rss.xml</link>
    <description>Recent content on Ubuntu security notices</description>
    <atom:link href="https://ubuntu.com/security/notices/rss.xml" rel="self"/>
    <copyright>2020 Canonical Ltd. Ubuntu and Canonical are registered trademarks of Canonical Ltd.</copyright>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>Feedgen</generator>
    <lastBuildDate>Wed, 02 Dec 2020 21:38:22 +0000</lastBuildDate>
    <item>
      <title>USN-9999-9: some-package vulnerability</title>
      <link>https://ubuntu.com/security/notices/USN-9999-9</link>
      <description>This is a fake vulnerability for testing</description>
      <guid isPermaLink="false">https://ubuntu.com/security/notices/USN-9999-9</guid>
      <pubDate>Tue, 01 Dec 2020 00:00:00 +0000</pubDate>
    </item>
    <item>
      <title>USN-4659-1: Linux kernel vulnerabilities</title>
      <link>https://ubuntu.com/security/notices/USN-4659-1</link>
      <description>It was discovered that a race condition existed in the binder IPC
implementation in the Linux kernel, leading to a use-after-free
vulnerability. A local attacker could use this to cause a denial of service
(system crash) or possibly execute arbitrary code. (CVE-2020-0423)

Daniele Antonioli, Nils Ole Tippenhauer, and Kasper Rasmussen discovered
that legacy pairing and secure-connections pairing authentication in the
Bluetooth protocol could allow an unauthenticated user to complete
authentication without pairing credentials via adjacent access. A
physically proximate attacker could use this to impersonate a previously
paired Bluetooth device. (CVE-2020-10135)

It was discovered that a race condition existed in the perf subsystem of
the Linux kernel, leading to a use-after-free vulnerability. An attacker
with access to the perf subsystem could use this to cause a denial of
service (system crash) or possibly execute arbitrary code. (CVE-2020-14351)

Keyu Man discovered that the ICMP global rate limiter in the Linux kernel
could be used to assist in scanning open UDP ports. A remote attacker could
use to facilitate attacks on UDP based services that depend on source port
randomization. (CVE-2020-25705)

It was discovered that the KVM hypervisor in the Linux kernel did not
properly handle interrupts in certain situations. A local attacker in a
guest VM could possibly use this to cause a denial of service (host system
crash). (CVE-2020-27152)

It was discovered that the framebuffer implementation in the Linux kernel
did not properly perform range checks in certain situations. A local
attacker could use this to expose sensitive information (kernel memory).
(CVE-2020-28915)

It was discovered that Power 9 processors could be coerced to expose
information from the L1 cache in certain situations. A local attacker could
use this to expose sensitive information. (CVE-2020-4788)
</description>
      <guid isPermaLink="false">https://ubuntu.com/security/notices/USN-4659-1</guid>
      <pubDate>Wed, 02 Dec 2020 02:18:58 +0000</pubDate>
    </item>
    <item>
      <title>USN-4657-1: Linux kernel vulnerabilities</title>
      <link>https://ubuntu.com/security/notices/USN-4657-1</link>
      <description>Elena Petrova discovered that the pin controller device tree implementation
in the Linux kernel did not properly handle string references. A local
attacker could use this to expose sensitive information (kernel memory).
(CVE-2020-0427)

Daniele Antonioli, Nils Ole Tippenhauer, and Kasper Rasmussen discovered
that legacy pairing and secure-connections pairing authentication in the
Bluetooth protocol could allow an unauthenticated user to complete
authentication without pairing credentials via adjacent access. A
physically proximate attacker could use this to impersonate a previously
paired Bluetooth device. (CVE-2020-10135)

Andy Nguyen discovered that the Bluetooth A2MP implementation in the Linux
kernel did not properly initialize memory in some situations. A physically
proximate remote attacker could use this to expose sensitive information
(kernel memory). (CVE-2020-12352)

It was discovered that a race condition existed in the perf subsystem of
the Linux kernel, leading to a use-after-free vulnerability. An attacker
with access to the perf subsystem could use this to cause a denial of
service (system crash) or possibly execute arbitrary code. (CVE-2020-14351)

It was discovered that the frame buffer implementation in the Linux kernel
did not properly handle some edge cases in software scrollback. A local
attacker could use this to cause a denial of service (system crash) or
possibly execute arbitrary code. (CVE-2020-14390)

It was discovered that the netfilter connection tracker for netlink in the
Linux kernel did not properly perform bounds checking in some situations. A
local attacker could use this to cause a denial of service (system crash).
(CVE-2020-25211)

It was discovered that the Rados block device (rbd) driver in the Linux
kernel did not properly perform privilege checks for access to rbd devices
in some situations. A local attacker could use this to map or unmap rbd
block devices. (CVE-2020-25284)

It was discovered that the HDLC PPP implementation in the Linux kernel did
not properly validate input in some situations. A local attacker could use
this to cause a denial of service (system crash) or possibly execute
arbitrary code. (CVE-2020-25643)

It was discovered that the GENEVE tunnel implementation in the Linux kernel
when combined with IPSec did not properly select IP routes in some
situations. An attacker could use this to expose sensitive information
(unencrypted network traffic). (CVE-2020-25645)

Keyu Man discovered that the ICMP global rate limiter in the Linux kernel
could be used to assist in scanning open UDP ports. A remote attacker could
use to facilitate attacks on UDP based services that depend on source port
randomization. (CVE-2020-25705)

It was discovered that the framebuffer implementation in the Linux kernel
did not properly perform range checks in certain situations. A local
attacker could use this to expose sensitive information (kernel memory).
(CVE-2020-28915)

It was discovered that Power 9 processors could be coerced to expose
information from the L1 cache in certain situations. A local attacker could
use this to expose sensitive information. (CVE-2020-4788)

</description>
      <guid isPermaLink="false">https://ubuntu.com/security/notices/USN-4657-1</guid>
      <pubDate>Wed, 02 Dec 2020 01:54:29 +0000</pubDate>
    </item>
    <item>
      <title>USN-4658-1: Linux kernel vulnerabilities</title>
      <link>https://ubuntu.com/security/notices/USN-4658-1</link>
      <description>It was discovered that a race condition existed in the binder IPC
implementation in the Linux kernel, leading to a use-after-free
vulnerability. A local attacker could use this to cause a denial of service
(system crash) or possibly execute arbitrary code. (CVE-2020-0423)

Daniele Antonioli, Nils Ole Tippenhauer, and Kasper Rasmussen discovered
that legacy pairing and secure-connections pairing authentication in the
Bluetooth protocol could allow an unauthenticated user to complete
authentication without pairing credentials via adjacent access. A
physically proximate attacker could use this to impersonate a previously
paired Bluetooth device. (CVE-2020-10135)

It was discovered that a race condition existed in the perf subsystem of
the Linux kernel, leading to a use-after-free vulnerability. An attacker
with access to the perf subsystem could use this to cause a denial of
service (system crash) or possibly execute arbitrary code. (CVE-2020-14351)

It was discovered that the frame buffer implementation in the Linux kernel
did not properly handle some edge cases in software scrollback. A local
attacker could use this to cause a denial of service (system crash) or
possibly execute arbitrary code. (CVE-2020-14390)

It was discovered that the netfilter connection tracker for netlink in the
Linux kernel did not properly perform bounds checking in some situations. A
local attacker could use this to cause a denial of service (system crash).
(CVE-2020-25211)

It was discovered that the Rados block device (rbd) driver in the Linux
kernel did not properly perform privilege checks for access to rbd devices
in some situations. A local attacker could use this to map or unmap rbd
block devices. (CVE-2020-25284)

It was discovered that the HDLC PPP implementation in the Linux kernel did
not properly validate input in some situations. A local attacker could use
this to cause a denial of service (system crash) or possibly execute
arbitrary code. (CVE-2020-25643)

It was discovered that the GENEVE tunnel implementation in the Linux kernel
when combined with IPSec did not properly select IP routes in some
situations. An attacker could use this to expose sensitive information
(unencrypted network traffic). (CVE-2020-25645)

Keyu Man discovered that the ICMP global rate limiter in the Linux kernel
could be used to assist in scanning open UDP ports. A remote attacker could
use to facilitate attacks on UDP based services that depend on source port
randomization. (CVE-2020-25705)

It was discovered that the framebuffer implementation in the Linux kernel
did not properly perform range checks in certain situations. A local
attacker could use this to expose sensitive information (kernel memory).
(CVE-2020-28915)

It was discovered that Power 9 processors could be coerced to expose
information from the L1 cache in certain situations. A local attacker could
use this to expose sensitive information. (CVE-2020-4788)
</description>
      <guid isPermaLink="false">https://ubuntu.com/security/notices/USN-4658-1</guid>
      <pubDate>Wed, 02 Dec 2020 01:38:52 +0000</pubDate>
    </item>
    <item>
      <title>USN-4656-1: X.Org X Server vulnerabilities</title>
      <link>https://ubuntu.com/security/notices/USN-4656-1</link>
      <description>Jan-Niklas Sohn discovered that the X.Org X Server XKB extension
incorrectly handled certain inputs. A local attacker could possibly use
this issue to escalate privileges.
</description>
      <guid isPermaLink="false">https://ubuntu.com/security/notices/USN-4656-1</guid>
      <pubDate>Tue, 01 Dec 2020 16:08:56 +0000</pubDate>
    </item>
    <item>
      <title>USN-4655-1: Werkzeug vulnerabilities</title>
      <link>https://ubuntu.com/security/notices/USN-4655-1</link>
      <description>It was discovered that Werkzeug has insufficient debugger PIN randomness.
An attacker could use this issue to access sensitive information. This issue only
affected Ubuntu 18.04 LTS. (CVE-2019-14806)

It was discovered that Werkzeug incorrectly handled certain URLs.
An attacker could possibly use this issue to cause pishing attacks.
This issue only affected Ubuntu 16.04 LTS. (CVE-2020-28724)
</description>
      <guid isPermaLink="false">https://ubuntu.com/security/notices/USN-4655-1</guid>
      <pubDate>Tue, 01 Dec 2020 13:57:45 +0000</pubDate>
    </item>
    <item>
      <title>USN-4654-1: PEAR vulnerabilities</title>
      <link>https://ubuntu.com/security/notices/USN-4654-1</link>
      <description>It was discovered that PEAR incorrectly sanitized filenames. A remote
attacker could possibly use this issue to execute arbitrary code.
</description>
      <guid isPermaLink="false">https://ubuntu.com/security/notices/USN-4654-1</guid>
      <pubDate>Tue, 01 Dec 2020 12:38:57 +0000</pubDate>
    </item>
    <item>
      <title>USN-4653-1: containerd vulnerability</title>
      <link>https://ubuntu.com/security/notices/USN-4653-1</link>
      <description>It was discovered that access controls for the shim's API socket did not
restrict access to the abstract unix domain socket in some cases. An attacker
could use this vulnerability to run containers with elevated privileges.
</description>
      <guid isPermaLink="false">https://ubuntu.com/security/notices/USN-4653-1</guid>
      <pubDate>Mon, 30 Nov 2020 21:04:43 +0000</pubDate>
    </item>
    <item>
      <title>USN-4652-1: SniffIt vulnerability</title>
      <link>https://ubuntu.com/security/notices/USN-4652-1</link>
      <description>It was discovered that SniffIt incorrectly handled certain configuration
files. An attacker could possibly use this issue to execute arbitrary code.
</description>
      <guid isPermaLink="false">https://ubuntu.com/security/notices/USN-4652-1</guid>
      <pubDate>Mon, 30 Nov 2020 16:24:06 +0000</pubDate>
    </item>
    <item>
      <title>USN-4651-1: MySQL vulnerabilities</title>
      <link>https://ubuntu.com/security/notices/USN-4651-1</link>
      <description>Tom Reynolds discovered that due to a packaging error, the MySQL X Plugin
was listening to all network interfaces by default, contrary to
expectations.

This update changes the default MySQL configuration to bind the MySQL X
Plugin to localhost only. This change may impact environments where the
MySQL X Plugin needs to be accessible from the network. The
mysqlx-bind-address setting in the /etc/mysql/mysql.conf.d/mysqld.cnf file
can be modified to allow network access.
</description>
      <guid isPermaLink="false">https://ubuntu.com/security/notices/USN-4651-1</guid>
      <pubDate>Mon, 30 Nov 2020 12:40:14 +0000</pubDate>
    </item>
  </channel>
</rss>


text:
namespace lldb_private {

//----------------------------------------------------------------------
/// @class CompletionRequest CompletionRequest.h
///   "lldb/Utility/ArgCompletionRequest.h"
///
/// Contains all information necessary to complete an incomplete command
/// for the user. Will be filled with the generated completions by the different
/// completions functions.
///
//----------------------------------------------------------------------
class CompletionRequest {
public:
  //----------------------------------------------------------
  /// Constructs a completion request.
  ///
  /// @param [in] command_line
  ///     The command line the user has typed at this point.
  ///
  /// @param [in] raw_cursor_pos
  ///     The position of the cursor in the command line string. Index 0 means
  ///     the cursor is at the start of the line. The completion starts from
  ///     this cursor position.
  ///
  /// @param [in] match_start_point
  /// @param [in] max_return_elements
  ///     If there is a match that is expensive to compute, these are here to
  ///     allow you to compute the completions in  batches.  Start the
  ///     completion from match_start_point, and return match_return_elements
  ///     elements.
  ///
  /// @param [out] matches
  ///     A list of matches that will be filled by the different completion
  ///     handlers.
  //----------------------------------------------------------
  CompletionRequest(llvm::StringRef command_line, unsigned raw_cursor_pos,
                    int match_start_point, int max_return_elements,
                    StringList &matches);

  llvm::StringRef GetRawLine() const { return m_command; }

  unsigned GetRawCursorPos() const { return m_raw_cursor_pos; }

  const Args &GetParsedLine() const { return m_parsed_line; }

  Args &GetParsedLine() { return m_parsed_line; }

  const Args &GetPartialParsedLine() const { return m_partial_parsed_line; }

  void SetCursorIndex(int i) { m_cursor_index = i; }
  int GetCursorIndex() const { return m_cursor_index; }

  void SetCursorCharPosition(int pos) { m_cursor_char_position = pos; }
  int GetCursorCharPosition() const { return m_cursor_char_position; }

  int GetMatchStartPoint() const { return m_match_start_point; }

  int GetMaxReturnElements() const { return m_max_return_elements; }

  bool GetWordComplete() { return m_word_complete; }

  void SetWordComplete(bool v) { m_word_complete = v; }

  /// Adds a possible completion string. If the completion was already
  /// suggested before, it will not be added to the list of results. A copy of
  /// the suggested completion is stored, so the given string can be free'd
  /// afterwards.
  ///
  /// @param match The suggested completion.
  void AddCompletion(llvm::StringRef completion) {
    // Add the completion if we haven't seen the same value before.
    if (m_match_set.insert(completion).second)
      m_matches->AppendString(completion);
  }

  /// Adds multiple possible completion strings.
  ///
  /// \param completions The list of completions.
  ///
  /// @see AddCompletion
  void AddCompletions(const StringList &completions) {
    for (std::size_t i = 0; i < completions.GetSize(); ++i)
      AddCompletion(completions.GetStringAtIndex(i));
  }

  std::size_t GetNumberOfMatches() const { return m_matches->GetSize(); }

  llvm::StringRef GetCursorArgument() const {
    return GetParsedLine().GetArgumentAtIndex(GetCursorIndex());
  }

  llvm::StringRef GetCursorArgumentPrefix() const {
    return GetCursorArgument().substr(0, GetCursorCharPosition());
  }

private:
  /// The raw command line we are supposed to complete.
  llvm::StringRef m_command;
  /// The cursor position in m_command.
  unsigned m_raw_cursor_pos;
  /// The command line parsed as arguments.
  Args m_parsed_line;
  /// The command line until the cursor position parsed as arguments.
  Args m_partial_parsed_line;
  /// The index of the argument in which the completion cursor is.
  int m_cursor_index;
  /// The cursor position in the argument indexed by m_cursor_index.
  int m_cursor_char_position;
  /// If there is a match that is expensive
  /// to compute, these are here to allow you to compute the completions in
  /// batches.  Start the completion from \amatch_start_point, and return
  /// \amatch_return_elements elements.
  // FIXME: These two values are not implemented.
  int m_match_start_point;
  int m_max_return_elements;
  /// \btrue if this is a complete option value (a space will be inserted
  /// after the completion.)  \bfalse otherwise.
  bool m_word_complete = false;

  // Note: This list is kept private. This is by design to prevent that any
  // completion depends on any already computed completion from another backend.
  // Note: We don't own the list. It's owned by the creator of the
  // CompletionRequest object.
  StringList *m_matches;

  /// List of added completions so far. Used to filter out duplicates.
  llvm::StringSet<> m_match_set;
};

} // namespace lldb_private

#endif // LLDB_UTILITY_COMPLETIONREQUEST_H

redpajama_set_name: RedPajamaGithub


text:
package br.gov.siscomex.portalunico.duimp_api.model;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import com.fasterxml.jackson.annotation.JsonProperty;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "MemoriaCalculoItemCover", propOrder =
    { "codigoFundamentoLegalNormal", "baseCalculoBRL", "baseCalculoEspecificaBRL", "baseCalculoReduzidaBRL", "percentualReducaoBaseCalculo", "tipoAliquota", "percentualReducaoAliquotaReduzida", "valorAliquota", "valorAliquotaEspecifica", "valorAliquotaReduzida", "normal", "tributado"
})

@XmlRootElement(name="MemoriaCalculoItemCover")
/**
  * Memória de cálculo por tipo de imposto.
 **/
@ApiModel(description="Memória de cálculo por tipo de imposto.")
public class MemoriaCalculoItemCover  {

  @XmlElement(name="codigoFundamentoLegalNormal")
  @ApiModelProperty(example = "1001", value = "Código do fundamento legal do regime tributário de importação utilizado na declaração.
Domínio: Fundamentos legais existentes no sistema Tratamento Tributário.
Tamanho: 16,7
Formato: Decimal, com até 7 casas decimais separadas por ponto.")
 /**
   * Código do fundamento legal do regime tributário de importação utilizado na declaração.
Domínio: Fundamentos legais existentes no sistema Tratamento Tributário.
Tamanho: 16,7
Formato: Decimal, com até 7 casas decimais separadas por ponto.
  **/
  private Integer codigoFundamentoLegalNormal = null;

  @XmlElement(name="baseCalculoBRL")
  @ApiModelProperty(example = "4567.8", value = "Valor da base de cálculo em R$ (Reais).
Tamanho: 16,7
Formato: Decimal, com até 7 casas decimais separadas por ponto.")
 /**
   * Valor da base de cálculo em R$ (Reais).
Tamanho: 16,7
Formato: Decimal, com até 7 casas decimais separadas por ponto.
  **/
  private Double baseCalculoBRL = null;

  @XmlElement(name="baseCalculoEspecificaBRL")
  @ApiModelProperty(example = "4567.8", value = "Valor da base de cálculo específica em R$ (Reais).
Tamanho: 16,7
Formato: Decimal, com até 7 casas decimais separadas por ponto.")
 /**
   * Valor da base de cálculo específica em R$ (Reais).
Tamanho: 16,7
Formato: Decimal, com até 7 casas decimais separadas por ponto.
  **/
  private Double baseCalculoEspecificaBRL = null;

  @XmlElement(name="baseCalculoReduzidaBRL")
  @ApiModelProperty(example = "4567.8", value = "Valor da base de cálculo reduzida em R$ (Reais).
Tamanho: 16,7
Formato: Decimal, com até 7 casas decimais separadas por ponto.")
 /**
   * Valor da base de cálculo reduzida em R$ (Reais).
Tamanho: 16,7
Formato: Decimal, com até 7 casas decimais separadas por ponto.
  **/
  private Double baseCalculoReduzidaBRL = null;

  @XmlElement(name="percentualReducaoBaseCalculo")
  @ApiModelProperty(example = "4567.8", value = "Percentual de redução da base de cálculo.
Tamanho: 16,5
Formato: Decimal, com até 5 casas decimais separadas por ponto.")
 /**
   * Percentual de redução da base de cálculo.
Tamanho: 16,5
Formato: Decimal, com até 5 casas decimais separadas por ponto.
  **/
  private Double percentualReducaoBaseCalculo = null;

@XmlType(name="TipoAliquotaEnum")
@XmlEnum(String.class)
public enum TipoAliquotaEnum {

	@XmlEnumValue("AD_VALOREM")
	@JsonProperty("AD_VALOREM")
	AD_VALOREM(String.valueOf("AD_VALOREM")),

	@XmlEnumValue("ESPECIFICA")
	@JsonProperty("ESPECIFICA")
	ESPECIFICA(String.valueOf("ESPECIFICA"));

    private String value;

    TipoAliquotaEnum (String v) {
        value = v;
    }

    public String value() {
        return value;
    }

    @Override
    public String toString() {
        return String.valueOf(value);
    }

    public static TipoAliquotaEnum fromValue(String v) {
        for (TipoAliquotaEnum b : TipoAliquotaEnum.values()) {
            if (String.valueOf(b.value).equals(v)) {
                return b;
            }
        }
        throw new IllegalArgumentException("Unexpected value '" + v + "' to TipoAliquotaEnum");
    }
}

  @XmlElement(name="tipoAliquota")
  @ApiModelProperty(example = "AD_VALOREM", value = "Tipo de alíquota do tributo.
Domínio:")
 /**
   * Tipo de alíquota do tributo.
Domínio:
  **/
  private TipoAliquotaEnum tipoAliquota = null;

  @XmlElement(name="percentualReducaoAliquotaReduzida")
  @ApiModelProperty(example = "4227.8", value = "Percentual de redução da alíquota reduzida (%).
Tamanho: 16,5
Formato: Decimal, com até 5 casas decimais separadas por ponto.")
 /**
   * Percentual de redução da alíquota reduzida (%).
Tamanho: 16,5
Formato: Decimal, com até 5 casas decimais separadas por ponto.
  **/
  private Double percentualReducaoAliquotaReduzida = null;

  @XmlElement(name="valorAliquota")
  @ApiModelProperty(example = "4227.8", value = "Valor da alíquota (%).
Tamanho: 16,7
Formato: Decimal, com até 7 casas decimais separadas por ponto.")
 /**
   * Valor da alíquota (%).
Tamanho: 16,7
Formato: Decimal, com até 7 casas decimais separadas por ponto.
  **/
  private Double valorAliquota = null;

  @XmlElement(name="valorAliquotaEspecifica")
  @ApiModelProperty(example = "4227.8", value = "Valor da alíquota específica (%).
Tamanho: 16,7
Formato: Decimal, com até 7 casas decimais separadas por ponto.")
 /**
   * Valor da alíquota específica (%).
Tamanho: 16,7
Formato: Decimal, com até 7 casas decimais separadas por ponto.
  **/
  private Double valorAliquotaEspecifica = null;

  @XmlElement(name="valorAliquotaReduzida")
  @ApiModelProperty(example = "4227.8", value = "Valor da alíquota reduzida (%).
Tamanho: 16,7
Formato: Decimal, com até 7 casas decimais separadas por ponto.")
 /**
   * Valor da alíquota reduzida (%).
Tamanho: 16,7
Formato: Decimal, com até 7 casas decimais separadas por ponto.
  **/
  private Double valorAliquotaReduzida = null;

  @XmlElement(name="normal")
  @ApiModelProperty(example = "4227.8", value = "Valor normal em R$ (Reais).
Tamanho: 16,7
Formato: Decimal, com até 7 casas decimais separadas por ponto.")
 /**
   * Valor normal em R$ (Reais).
Tamanho: 16,7
Formato: Decimal, com até 7 casas decimais separadas por ponto.
  **/
  private Double normal = null;

  @XmlElement(name="tributado")
  @ApiModelProperty(example = "true", value = "Indicador de tributação.")
 /**
   * Indicador de tributação.
  **/
  private Boolean tributado = null;
 /**
   * Código do fundamento legal do regime tributário de importação utilizado na declaração.<br>Domínio: Fundamentos legais existentes no sistema Tratamento Tributário.<br>Tamanho: 16,7<br>Formato: Decimal, com até 7 casas decimais separadas por ponto.
   * @return codigoFundamentoLegalNormal
  **/
  @JsonProperty("codigoFundamentoLegalNormal")
  public Integer getCodigoFundamentoLegalNormal() {
    return codigoFundamentoLegalNormal;
  }

  public void setCodigoFundamentoLegalNormal(Integer codigoFundamentoLegalNormal) {
    this.codigoFundamentoLegalNormal = codigoFundamentoLegalNormal;
  }

  public MemoriaCalculoItemCover codigoFundamentoLegalNormal(Integer codigoFundamentoLegalNormal) {
    this.codigoFundamentoLegalNormal = codigoFundamentoLegalNormal;
    return this;
  }

 /**
   * Valor da base de cálculo em R$ (Reais).<br>Tamanho: 16,7<br>Formato: Decimal, com até 7 casas decimais separadas por ponto.
   * @return baseCalculoBRL
  **/
  @JsonProperty("baseCalculoBRL")
  public Double getBaseCalculoBRL() {
    return baseCalculoBRL;
  }

  public void setBaseCalculoBRL(Double baseCalculoBRL) {
    this.baseCalculoBRL = baseCalculoBRL;
  }

  public MemoriaCalculoItemCover baseCalculoBRL(Double baseCalculoBRL) {
    this.baseCalculoBRL = baseCalculoBRL;
    return this;
  }

 /**
   * Valor da base de cálculo específica em R$ (Reais).<br>Tamanho: 16,7<br>Formato: Decimal, com até 7 casas decimais separadas por ponto.
   * @return baseCalculoEspecificaBRL
  **/
  @JsonProperty("baseCalculoEspecificaBRL")
  public Double getBaseCalculoEspecificaBRL() {
    return baseCalculoEspecificaBRL;
  }

  public void setBaseCalculoEspecificaBRL(Double baseCalculoEspecificaBRL) {
    this.baseCalculoEspecificaBRL = baseCalculoEspecificaBRL;
  }

  public MemoriaCalculoItemCover baseCalculoEspecificaBRL(Double baseCalculoEspecificaBRL) {
    this.baseCalculoEspecificaBRL = baseCalculoEspecificaBRL;
    return this;
  }

 /**
   * Valor da base de cálculo reduzida em R$ (Reais).<br>Tamanho: 16,7<br>Formato: Decimal, com até 7 casas decimais separadas por ponto.
   * @return baseCalculoReduzidaBRL
  **/
  @JsonProperty("baseCalculoReduzidaBRL")
  public Double getBaseCalculoReduzidaBRL() {
    return baseCalculoReduzidaBRL;
  }

  public void setBaseCalculoReduzidaBRL(Double baseCalculoReduzidaBRL) {
    this.baseCalculoReduzidaBRL = baseCalculoReduzidaBRL;
  }

  public MemoriaCalculoItemCover baseCalculoReduzidaBRL(Double baseCalculoReduzidaBRL) {
    this.baseCalculoReduzidaBRL = baseCalculoReduzidaBRL;
    return this;
  }

 /**
   * Percentual de redução da base de cálculo.<br>Tamanho: 16,5<br>Formato: Decimal, com até 5 casas decimais separadas por ponto.
   * @return percentualReducaoBaseCalculo
  **/
  @JsonProperty("percentualReducaoBaseCalculo")
  public Double getPercentualReducaoBaseCalculo() {
    return percentualReducaoBaseCalculo;
  }

  public void setPercentualReducaoBaseCalculo(Double percentualReducaoBaseCalculo) {
    this.percentualReducaoBaseCalculo = percentualReducaoBaseCalculo;
  }

  public MemoriaCalculoItemCover percentualReducaoBaseCalculo(Double percentualReducaoBaseCalculo) {
    this.percentualReducaoBaseCalculo = percentualReducaoBaseCalculo;
    return this;
  }

 /**
   * Tipo de alíquota do tributo.<br>Domínio:
   * @return tipoAliquota
  **/
  @JsonProperty("tipoAliquota")
  public String getTipoAliquota() {
    if (tipoAliquota == null) {
      return null;
    }
    return tipoAliquota.value();
  }

  public void setTipoAliquota(TipoAliquotaEnum tipoAliquota) {
    this.tipoAliquota = tipoAliquota;
  }

  public MemoriaCalculoItemCover tipoAliquota(TipoAliquotaEnum tipoAliquota) {
    this.tipoAliquota = tipoAliquota;
    return this;
  }

 /**
   * Percentual de redução da alíquota reduzida (%).<br>Tamanho: 16,5<br>Formato: Decimal, com até 5 casas decimais separadas por ponto.
   * @return percentualReducaoAliquotaReduzida
  **/
  @JsonProperty("percentualReducaoAliquotaReduzida")
  public Double getPercentualReducaoAliquotaReduzida() {
    return percentualReducaoAliquotaReduzida;
  }

  public void setPercentualReducaoAliquotaReduzida(Double percentualReducaoAliquotaReduzida) {
    this.percentualReducaoAliquotaReduzida = percentualReducaoAliquotaReduzida;
  }

  public MemoriaCalculoItemCover percentualReducaoAliquotaReduzida(Double percentualReducaoAliquotaReduzida) {
    this.percentualReducaoAliquotaReduzida = percentualReducaoAliquotaReduzida;
    return this;
  }

 /**
   * Valor da alíquota (%).<br>Tamanho: 16,7<br>Formato: Decimal, com até 7 casas decimais separadas por ponto.
   * @return valorAliquota
  **/
  @JsonProperty("valorAliquota")
  public Double getValorAliquota() {
    return valorAliquota;
  }

  public void setValorAliquota(Double valorAliquota) {
    this.valorAliquota = valorAliquota;
  }

  public MemoriaCalculoItemCover valorAliquota(Double valorAliquota) {
    this.valorAliquota = valorAliquota;
    return this;
  }

 /**
   * Valor da alíquota específica (%).<br>Tamanho: 16,7<br>Formato: Decimal, com até 7 casas decimais separadas por ponto.
   * @return valorAliquotaEspecifica
  **/
  @JsonProperty("valorAliquotaEspecifica")
  public Double getValorAliquotaEspecifica() {
    return valorAliquotaEspecifica;
  }

  public void setValorAliquotaEspecifica(Double valorAliquotaEspecifica) {
    this.valorAliquotaEspecifica = valorAliquotaEspecifica;
  }

  public MemoriaCalculoItemCover valorAliquotaEspecifica(Double valorAliquotaEspecifica) {
    this.valorAliquotaEspecifica = valorAliquotaEspecifica;
    return this;
  }

 /**
   * Valor da alíquota reduzida (%).<br>Tamanho: 16,7<br>Formato: Decimal, com até 7 casas decimais separadas por ponto.
   * @return valorAliquotaReduzida
  **/
  @JsonProperty("valorAliquotaReduzida")
  public Double getValorAliquotaReduzida() {
    return valorAliquotaReduzida;
  }

  public void setValorAliquotaReduzida(Double valorAliquotaReduzida) {
    this.valorAliquotaReduzida = valorAliquotaReduzida;
  }

  public MemoriaCalculoItemCover valorAliquotaReduzida(Double valorAliquotaReduzida) {
    this.valorAliquotaReduzida = valorAliquotaReduzida;
    return this;
  }

 /**
   * Valor normal em R$ (Reais).<br>Tamanho: 16,7<br>Formato: Decimal, com até 7 casas decimais separadas por ponto.
   * @return normal
  **/
  @JsonProperty("normal")
  public Double getNormal() {
    return normal;
  }

  public void setNormal(Double normal) {
    this.normal = normal;
  }

  public MemoriaCalculoItemCover normal(Double normal) {
    this.normal = normal;
    return this;
  }

 /**
   * Indicador de tributação.
   * @return tributado
  **/
  @JsonProperty("tributado")
  public Boolean isTributado() {
    return tributado;
  }

  public void setTributado(Boolean tributado) {
    this.tributado = tributado;
  }

  public MemoriaCalculoItemCover tributado(Boolean tributado) {
    this.tributado = tributado;
    return this;
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class MemoriaCalculoItemCover {\n");

    sb.append("    codigoFundamentoLegalNormal: ").append(toIndentedString(codigoFundamentoLegalNormal)).append("\n");
    sb.append("    baseCalculoBRL: ").append(toIndentedString(baseCalculoBRL)).append("\n");
    sb.append("    baseCalculoEspecificaBRL: ").append(toIndentedString(baseCalculoEspecificaBRL)).append("\n");
    sb.append("    baseCalculoReduzidaBRL: ").append(toIndentedString(baseCalculoReduzidaBRL)).append("\n");
    sb.append("    percentualReducaoBaseCalculo: ").append(toIndentedString(percentualReducaoBaseCalculo)).append("\n");
    sb.append("    tipoAliquota: ").append(toIndentedString(tipoAliquota)).append("\n");
    sb.append("    percentualReducaoAliquotaReduzida: ").append(toIndentedString(percentualReducaoAliquotaReduzida)).append("\n");
    sb.append("    valorAliquota: ").append(toIndentedString(valorAliquota)).append("\n");
    sb.append("    valorAliquotaEspecifica: ").append(toIndentedString(valorAliquotaEspecifica)).append("\n");
    sb.append("    valorAliquotaReduzida: ").append(toIndentedString(valorAliquotaReduzida)).append("\n");
    sb.append("    normal: ").append(toIndentedString(normal)).append("\n");
    sb.append("    tributado: ").append(toIndentedString(tributado)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private static String toIndentedString(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}


text:
package com.pineone.icbms.so.virtualobject.composite;

import com.pineone.icbms.so.virtualobject.IGenericVirtualObject;
import com.pineone.icbms.so.virtualobject.aspect.IGenericAspect;
import com.pineone.icbms.so.virtualobject.common.IGenericServiceEntity;
import com.pineone.icbms.so.virtualobject.function.IGenericFunction;

import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * Composite Virtual Object generic interface.

 *
 * Created by uni4love on 2016. 11. 17..
 */
public interface IGenericCompositeVirtualObject extends ICompositeVirtualObject<IGenericVirtualObject>, IGenericServiceEntity {

	String getCvoType();
	String getPhysicalDeviceTypeId();
	String getDeviceId();
	String getBaseCvoId();
	String getLocationId();
	String getOsId();

	/**
     * return virtual object list.

     *
     * @return virtual object list
     */
    List<IGenericVirtualObject> getVirtualObjectList();

    /**
     * add a Virtual Object.

     *
     * @param virtualObject virtual object
     */
    void addVirtualObject(IGenericVirtualObject virtualObject);

    /**
     * return current vo tree depth.

     *
     * @return depth
     */
    int getCurrentDepth();

    /**
     * set current vo tree depth.

     *
     * @param depth depth
     */
    void setCurrentDepth(int depth);

}


text:
require 'rubygems'
require_gem 'rails'
require 'action_controller/test_process'
require 'test/unit'
require 'init'

ActionController::Base.template_root = 'test/fixtures'

ActionController::Routing::Routes.draw do |map|
  map.connect ':controller/:action/:id'
end

# The base class for testing.
class MockController < ActionController::Base
  def rescue_action(e) raise e end;

  def index
    render :text => "Welcome to WonderPuppy's Happy Magic Pony Palace!"
  end

  def secret_ferret_brigade
    render :text => "Congratulations! You're obviously a member of the Secret Ferret Brigade!"
  end

  def logout
    render :text => 'Really, no reason why you should see this.'
  end
end

# This should accept all requests.
class OpenUselessController < MockController
  requires_authentication :using => lambda{ |u, p| true }
end

# This should block all requests.
class ClosedUselessController < MockController
  requires_authentication :using => lambda{ |u, p| false }
end

# Authenticates only for the Secret Ferret Brigade(tm).
class AuthOnlyController < MockController
  requires_authentication :using => lambda{ |u, p| u == 'ferret' && p == 'REVOLUTION' },
                          :only => [:secret_ferret_brigade]
end

# Authenticates only for the Secret Ferret Brigade(tm), but the other way around.
class AuthExceptController < MockController
  requires_authentication :using => lambda{ |u, p| u == 'ferret' && p == 'REVOLUTION' },
                          :except => [:index]
end

# This shouldn't actually protect anything -- :except takes priority.
class ContradictoryController < MockController
  requires_authentication :using => lambda{ |u, p| u == 'ferret' && p == 'REVOLUTION' },
                          :only => [:index],
                          :except => [:index]
end

# This should just protect :secret_ferret_brigade
class OverlySpecificController < MockController
  requires_authentication :using => lambda{ |u, p| u == 'ferret' && p == 'REVOLUTION' },
                          :only => [:secret_ferret_brigade],
                          :except => [:index]
end

# Uses a controller method instead of a Proc.
class PrivateMethodController < MockController
  requires_authentication :using => :authenticate
private
  def authenticate(username, password)
    username == 'ferret' && password == 'REVOLUTION'
  end
end

# Specifies a realm
class RealmController < MockController
  requires_authentication :using => lambda{ |u, p| u == 'ferret' && p == 'REVOLUTION' },
                          :realm => "GOURANGA!"
end

# Uses a different list of possible headers.
class DifferentHeaderController < MockController
  requires_authentication :using => lambda{ |u, p| u == 'ferret' && p == 'REVOLUTION' },
                          :at => ['MY_OWN_MAGIC1', 'MY_OWN_MAGIC2']
end

# Allows the user to log out.
class LogoutController < MockController
  requires_authentication :using => lambda{ |u, p| u == 'u' && p == 'p' },
                          :logout_on => :logout
end

class SimpleHttpAuthTest < Test::Unit::TestCase

  def setup
    @request    = ActionController::TestRequest.new
    @response   = ActionController::TestResponse.new
  end

  # There's enough jiggery-pokery with the Rails internals here that I want to
  # make sure this won't eat some kind of horrible, orphan-killing,
  # false-negative-generating flaming death while my back's turned. Call me
  # paranoid; I dare you.
  def test_make_sure_the_testing_structure_works
    make_controller :mock
    get :index
    assert_response :success
    get :secret_ferret_brigade
    assert_response :success
  end

  # Make sure we're accepted or bounced at all.
  def test_useless_configurations
    make_controller :open_useless
    get :index
    assert_response :success
    get :secret_ferret_brigade
    assert_response :success

    make_controller :closed_useless
    get :index
    assert_protected
    get :secret_ferret_brigade
    assert_protected
  end

  # Make sure we limit ourselves properly.
  def test_auth_only
    make_controller :auth_only
    get :index
    assert_response :success
    get :secret_ferret_brigade
    assert_protected
  end

  # Make sure we can log in.
  def test_auth_only_actually_logging_in
    test_auth_only
    login :secret_ferret_brigade, 'ferret', 'REVOLUTION'
    assert_response :success
    login :secret_ferret_brigade, 'ferret', 'WRONGPASSWORD'
    assert_protected
  end

  # Make sure we don't box ourselve in, eh?
  def test_contradictory
    make_controller :contradictory
    get :index
    assert_response :success
    get :secret_ferret_brigade
    assert_response :success
  end

  # Erring on the Side of Verbosity should Never incur Penalties beyond, perhaps,
  # the Animonsity and Misapprehension of the Hoi Polloi, though said Slings and
  # Arrows are themselves, as the Bard had it, Outrageous in their Illogical and
  # Arbitrary Application by either Providence or Fortune, the Difference
  # between which is Said to comprise the Greater Portion of Wisdom, and Should,
  # at All Costs, be Avoided in Part and in Whole.
  def test_overly_specific
    make_controller :overly_specific
    get :index
    assert_response :success
    get :secret_ferret_brigade
    assert_protected
  end

  # Make sure we limit ourselves properly.
  def test_auth_except
    make_controller :auth_except
    get :index
    assert_response :success
    get :secret_ferret_brigade
    assert_protected
  end

  # Make sure we can log in.
  def test_auth_except_actually_logging_in
    test_auth_except
    login :secret_ferret_brigade, 'ferret', 'REVOLUTION'
    assert_response :success

    login :secret_ferret_brigade, 'ferret', 'WRONGPASSWORD!'
    assert_protected
  end

  # Make sure we can use a controller method.
  def test_private_method
    make_controller :private_method
    get :index
    assert_protected
    get :secret_ferret_brigade
    assert_protected
  end

  # Make sure we can log in.
  def test_private_method_actually_logging_in
    test_private_method
    login :index, 'ferret', 'REVOLUTION'
    assert_response :success
    login :index, 'ferret', 'WRONGPASSWORD'
    assert_protected
  end

  # Make sure our realm shows up.
  def test_realm
    make_controller :realm
    get :index
    assert_protected
    assert_equal 'Basic realm="GOURANGA!"', @response.headers['WWW-Authenticate']
  end

  # Make sure we can specify different headers.
  def test_different_method
    make_controller :different_header
    get :index
    assert_protected
    login :index, 'ferret', 'REVOLUTION', 'MY_OWN_MAGIC1'
    assert_response :success
    login :index, 'ferret', 'REVOLUTION', 'MY_OWN_MAGIC2'
    assert_response :success
  end

  # Make sure that logging us out actually does so.
  def test_logging_out
    make_controller :logout
    login :index, 'u', 'p'
    assert_response :success
    login :index, 'u', 'ping'
    assert_protected
    login :logout, 'u', 'p'
    assert_protected 'You have successfully logged out.'
  end

  # Make sure Julien's bug is fixed
  def test_multiline_credentials
    make_controller :auth_only

    @request.env['HTTP_AUTHORIZATION'] = "Basic MjoT2yEbWGt02kaRJW7KZPCbZBQBPuQGaajMpUKN3npIlsWTgbs89Nkjk5iZ\nAvrsMVbgYeahS4ljXySP04sF8xf9\n"
    get :index

    SimpleHTTPAuthentication::ActionFilter.instance_eval do
      public :get_auth_data
    end

    begin
      af = SimpleHTTPAuthentication::ActionFilter.new({})
      username, password = af.get_auth_data(@controller)
    ensure
     SimpleHTTPAuthentication::ActionFilter.instance_eval do
        private :get_auth_data
      end
    end

    assert_equal 64, password.size
  end

private

  # Since we're testing different controllers, here's a little sump'en-sump'en
  # to make my life easier. Also? It looks cooler.
  def make_controller(klass)
    @controller = eval("#{klass.to_s.camelize}Controller").new
  end

  # Logs in to an action using the specified username and password.
  def login(action, username, password, header = 'HTTP_AUTHORIZATION')
    @request.env[header] = "Basic #{Base64.encode64(username << ':' << password)}"
    get action
  end

  # Short-hand for "no, you can't play with us"
  def assert_protected(msg = "401 Unauthorized: You are not authorized to view this page.")
    assert_response 401
    assert_equal msg, @response.body
  end

end


text:
blnLocRunning = false;
blnInBackground = false;
strHost = "";
intCompNo = 0;
intSeqNo = 0;
strTechID = "";

var app = {
    // Application Constructor
    initialize: function() {
        this.bindEvents();
    },
    // Bind Event Listeners
    //
    // Bind any events that are required on startup. Common events are:
    // 'load', 'deviceready', 'offline', and 'online'.
    bindEvents: function() {
        document.addEventListener('deviceready', this.onDeviceReady, false);
    },
    // deviceready Event Handler
    //
    // The scope of 'this' is the event. In order to call the 'receivedEvent'
    // function, we must explicitly call 'app.receivedEvent(...);'
    onDeviceReady: function() {
        app.receivedEvent('deviceready');
        document.addEventListener("pause", onPause, false);
        document.addEventListener("resume", onResume, false);
    },
    // Update DOM on a Received Event
    receivedEvent: function(id) {
        //alert("In receivedEvent");
        console.log("In receivedEvent 01");
        fillvars();
        checkvalues(false);
        console.log('Received Event: ' + id);
    }
};

function onResume() {
    console.log("app resumed");
    blnInBackground = false;
    fillvars();
    checkvalues(false);
    return;
}

function onPause() {
    blnInBackground = true;
    return;
}

function alertDismissed() {
    return;
}

function fillvars() {
    if (localStorage.LocHost)
    {
        strHost = localStorage.LocHost;
        document.getElementById('txtHost').value = strHost;
    }
    if (localStorage.LocCompNo)
    {
        intval = parseInt(localStorage.LocCompNo, 10);
        intCompNo = 0;
        if (intval > 0 && intval < 1000)
        {
            intCompNo = intval;
        }
        if (intCompNo > 0)
        {
            document.getElementById('txtCompNo').value = intCompNo;
        }

    }
    if (localStorage.LocTechID)
    {
        strTechID = localStorage.LocTechID;
        document.getElementById('txtTechID').value = strTechID;
    }
}

function checkvalues(ShowError) {
    blnError = false;
    strError = "";
    lenHost = document.getElementById('txtHost').value.length;
    if (lenHost < 1)
    {
        strError += "Invalid Host or IP address\r\n";
        blnErrro = true;
    }
    intVal = parseInt(document.getElementById('txtCompNo').value, 10);
    if (isNaN(intVal))
    {
        intVal = 0;
    }
    if (intVal < 1 || intVal > 999)
    {
        strError += "Invalid Company number\r\n";
        blnError = true;
    }
    lenTechID = document.getElementById('txtTechID').value.length;
    if (lenTechID < 1)
    {
        strError += "Invalid TechID\r\n";
        blnError = true;
    }
    if (ShowError && blnError)
    {
        navigator.notification.alert(
            strError,
            alertDismissed,
            'Error in input fields',
            'OK'
        );
    }
    if (blnLocRunning)
    {
        document.getElementById('btnStart').disabled = true;
        document.getElementById('btnStop').disabled = false;
        document.getElementById('backstatus').innerHTML = "Broadcasting locations";
    } else {
        document.getElementById('btnStart').disabled = false;
        document.getElementById('btnStop').disabled = true;
        document.getElementById('backstatus').innerHTML = "Not broadcasting location";
    }
    return blnError;
}

function start() {
//    if (blnLocRunning)
//    {
//        return;
//    }
    /* If checkvalues returns true then errors were found */
    if (checkvalues(true))
    {
        return;
    }
    strHost = document.getElementById('txtHost').value;
    strCompNo = document.getElementById('txtCompNo').value;
    intCompNo = parseInt(strCompNo, 10);
    strTechID = document.getElementById('txtTechID').value;
    localStorage.setItem("LocHost", strHost);
    localStorage.setItem("LocCompNo", intCompNo);
    localStorage.setItem("LocTechID", strTechID);
    intSeqNo = 0;

    // Your app must execute AT LEAST ONE call for the current position via standard Cordova geolocation,
    //  in order to prompt the user for Location permission.
    window.navigator.geolocation.getCurrentPosition(function(location) {
        console.log('Location from Phonegap');
    });

    backgroundGeolocation = window.backgroundGeolocation || window.backgroundGeoLocation || window.universalGeolocation;

    /**
    * This callback will be executed every time a geolocation is recorded in the background.
    */
    var callbackFn = function(location,blnBackground) {
        var d = new Date();
        if (!blnBackground)
        {
            document.getElementById('backstatus').innerHTML = "Sending broadcasts" + " " + d.toLocaleString();
        }

        console.log('[js] backgroundGeolocation callback:  ' + location.latitude + ',' + location.longitude + " " + d.toLocaleString());
        sendupdate(location);
        // Do your HTTP request here to POST location to your server.
        // jQuery.post(url, JSON.stringify(location));

        /*
        IMPORTANT:  You must execute the finish method here to inform the native plugin that you're finished,
        and the background-task may be completed.  You must do this regardless if your HTTP request is successful or not.
        IF YOU DON'T, ios will CRASH YOUR APP for spending too much time in the background.
        */
        backgroundGeolocation.finish();
    };

    function sendupdate(location) {
        xmlhttp = new XMLHttpRequest();
        if (!xmlhttp)
        {
            console.log("Could not transmit - no xmlhttp");
            return;
        }
        xmlhttp.onreadystatechange = function() {
            if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
            {
                var xmlDoc = xmlhttp.responseText;
                console.log("Got post response: " + xmlDoc);
            }
        };

        var d = new Date();
        var strUpdTime = formatdate(d);
        var mph = Math.round(location.speed * 3600 / 1610.3*1000)/1000;
        var locupdate = "request-cd=XLOC&comp-no=" + localStorage.LocCompNo +
                       "&tech-id=" + localStorage.LocTechID + "&longitude=" +
                       location.longitude + "&latitude=" + location.latitude +
                       "&accuracy=" + location.accuracy + "&speed=" +
                       mph + "&timestamp=" + strUpdTime +
                       "&resp-page=locupdresult.htm&error-page=" +
                       "locupderr.html";
        var url="https://" + localStorage.LocHost + "/cgi-bin/facshtml.cgi";
        console.log(url);
        console.log(locupdate);
        xmlhttp.open("POST",url,true);
        xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
        xmlhttp.responseType = "text";
        xmlhttp.send(locupdate);
    }

    var failureFn = function(error) {
        console.log('BackgroundGeolocation error');
    };

    // BackgroundGeolocation is highly configurable. See platform specific configuration options
    backgroundGeolocation.configure(callbackFn, failureFn, {
        desiredAccuracy: 0,
        stationaryRadius: 5,
        distanceFilter: 5,
        notificationTitle: 'FACS Background Tracking',
        notificationText: 'enabled',
        activityType: 'Fitness',
        debug: false,
        pauseLocationUpdates: false,
        startOnBoot: false,
        startForeground: true,
        locationProvider: 1,
        saveBatteryOnBackground: false,
        interval: 10000,
        fastestInterval: 500
    });

    console.log("Start Tracking");
    // Turn ON the background-geolocation system.  The user will be tracked whenever they suspend the app.
    backgroundGeolocation.start();
    console.log("Tracking Started");

    blnLocRunning = true;

    checkvalues(false);
    // If you wish to turn OFF background-tracking, call the #stop method.
    // backgroundGeolocation.stop();

//    alert("Start Tracking");
}

function formatdate(dt) {
	strYear = dt.getFullYear().toString();
	var mth = dt.getMonth() + 1;
	var str = mth.toString();
	strMonth = pad(str, 2, '0', STR_PAD_LEFT);
	str = dt.getDate().toString();
	strDay = pad(str, 2, '0', STR_PAD_LEFT);
	var hrs = dt.getHours().toString();
	var mins = dt.getMinutes().toString();
	var strTime = pad(hrs, 2, '0', STR_PAD_LEFT) + ":" +
	              pad(mins,2, '0', STR_PAD_LEFT);
	return strYear + "-" + strMonth + "-" + strDay + " " + strTime;
}

/**
 *
 * Javascript string pad http://www.webtoolkit.info/
 *
 */

var STR_PAD_LEFT = 1;
var STR_PAD_RIGHT = 2;
var STR_PAD_BOTH = 3;

function pad(str, len, pad, dir) {
	if (str == undefined) {
		return -1;
	}
	if (typeof (len) == "undefined") {
		len = 0;
	}
	if (typeof (pad) == "undefined") {
		pad = ' ';
	}
	if (typeof (dir) == "undefined") {
		dir = STR_PAD_RIGHT;
	}

	if (len + 1 >= str.length) {

		switch (dir) {

		case STR_PAD_LEFT:
			str = Array(len + 1 - str.length).join(pad) + str;
			break;

		case STR_PAD_BOTH:
			var right = Math.ceil((padlen = len - str.length) / 2);
			var left = padlen - right;
			str = Array(left + 1).join(pad) + str + Array(right + 1).join(pad);
			break;

		default:
			str = str + Array(len + 1 - str.length).join(pad);
			break;

		} // switch

	}

	return str;

}

function stop() {
    if (!blnLocRunning)
    {
        return;
    }
    backgroundGeolocation.stop();
    blnLocRunning = false;
    checkvalues(false);
}


text:
namespace boost {
namespace asio {

namespace detail
{
  template <typename SyncReadStream, typename MutableBufferSequence,
      typename MutableBufferIterator, typename CompletionCondition>
  std::size_t read_buffer_sequence(SyncReadStream& s,
      const MutableBufferSequence& buffers, const MutableBufferIterator&,
      CompletionCondition completion_condition, boost::system::error_code& ec)
  {
    ec = boost::system::error_code();
    boost::asio::detail::consuming_buffers<mutable_buffer,
        MutableBufferSequence, MutableBufferIterator> tmp(buffers);
    while (!tmp.empty())
    {
      if (std::size_t max_size = detail::adapt_completion_condition_result(
            completion_condition(ec, tmp.total_consumed())))
        tmp.consume(s.read_some(tmp.prepare(max_size), ec));
      else
        break;
    }
    return tmp.total_consumed();;
  }
} // namespace detail

template <typename SyncReadStream, typename MutableBufferSequence,
    typename CompletionCondition>
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
    CompletionCondition completion_condition, boost::system::error_code& ec,
    typename enable_if<
      is_mutable_buffer_sequence<MutableBufferSequence>::value
    >::type*)
{
  return detail::read_buffer_sequence(s, buffers,
      boost::asio::buffer_sequence_begin(buffers),
      BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
}

template <typename SyncReadStream, typename MutableBufferSequence>
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
    typename enable_if<
      is_mutable_buffer_sequence<MutableBufferSequence>::value
    >::type*)
{
  boost::system::error_code ec;
  std::size_t bytes_transferred = read(s, buffers, transfer_all(), ec);
  boost::asio::detail::throw_error(ec, "read");
  return bytes_transferred;
}

template <typename SyncReadStream, typename MutableBufferSequence>
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
    boost::system::error_code& ec,
    typename enable_if<
      is_mutable_buffer_sequence<MutableBufferSequence>::value
    >::type*)
{
  return read(s, buffers, transfer_all(), ec);
}

template <typename SyncReadStream, typename MutableBufferSequence,
    typename CompletionCondition>
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
    CompletionCondition completion_condition,
    typename enable_if<
      is_mutable_buffer_sequence<MutableBufferSequence>::value
    >::type*)
{
  boost::system::error_code ec;
  std::size_t bytes_transferred = read(s, buffers,
      BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
  boost::asio::detail::throw_error(ec, "read");
  return bytes_transferred;
}

#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)

template <typename SyncReadStream, typename DynamicBuffer_v1,
    typename CompletionCondition>
std::size_t read(SyncReadStream& s,
    BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
    CompletionCondition completion_condition, boost::system::error_code& ec,
    typename enable_if<
      is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
        && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
    >::type*)
{
  typename decay<DynamicBuffer_v1>::type b(
      BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers));

  ec = boost::system::error_code();
  std::size_t total_transferred = 0;
  std::size_t max_size = detail::adapt_completion_condition_result(
        completion_condition(ec, total_transferred));
  std::size_t bytes_available = std::min<std::size_t>(
        std::max<std::size_t>(512, b.capacity() - b.size()),
        std::min<std::size_t>(max_size, b.max_size() - b.size()));
  while (bytes_available > 0)
  {
    std::size_t bytes_transferred = s.read_some(b.prepare(bytes_available), ec);
    b.commit(bytes_transferred);
    total_transferred += bytes_transferred;
    max_size = detail::adapt_completion_condition_result(
          completion_condition(ec, total_transferred));
    bytes_available = std::min<std::size_t>(
          std::max<std::size_t>(512, b.capacity() - b.size()),
          std::min<std::size_t>(max_size, b.max_size() - b.size()));
  }
  return total_transferred;
}

template <typename SyncReadStream, typename DynamicBuffer_v1>
inline std::size_t read(SyncReadStream& s,
    BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
    typename enable_if<
      is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
        && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
    >::type*)
{
  boost::system::error_code ec;
  std::size_t bytes_transferred = read(s,
      BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers), transfer_all(), ec);
  boost::asio::detail::throw_error(ec, "read");
  return bytes_transferred;
}

template <typename SyncReadStream, typename DynamicBuffer_v1>
inline std::size_t read(SyncReadStream& s,
    BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
    boost::system::error_code& ec,
    typename enable_if<
      is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
        && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
    >::type*)
{
  return read(s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
      transfer_all(), ec);
}

template <typename SyncReadStream, typename DynamicBuffer_v1,
    typename CompletionCondition>
inline std::size_t read(SyncReadStream& s,
    BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
    CompletionCondition completion_condition,
    typename enable_if<
      is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
        && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
    >::type*)
{
  boost::system::error_code ec;
  std::size_t bytes_transferred = read(s,
      BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
      BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
  boost::asio::detail::throw_error(ec, "read");
  return bytes_transferred;
}

#if !defined(BOOST_ASIO_NO_EXTENSIONS)
#if !defined(BOOST_ASIO_NO_IOSTREAM)

template <typename SyncReadStream, typename Allocator,
    typename CompletionCondition>
inline std::size_t read(SyncReadStream& s,
    boost::asio::basic_streambuf<Allocator>& b,
    CompletionCondition completion_condition, boost::system::error_code& ec)
{
  return read(s, basic_streambuf_ref<Allocator>(b),
      BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
}

template <typename SyncReadStream, typename Allocator>
inline std::size_t read(SyncReadStream& s,
    boost::asio::basic_streambuf<Allocator>& b)
{
  return read(s, basic_streambuf_ref<Allocator>(b));
}

template <typename SyncReadStream, typename Allocator>
inline std::size_t read(SyncReadStream& s,
    boost::asio::basic_streambuf<Allocator>& b,
    boost::system::error_code& ec)
{
  return read(s, basic_streambuf_ref<Allocator>(b), ec);
}

template <typename SyncReadStream, typename Allocator,
    typename CompletionCondition>
inline std::size_t read(SyncReadStream& s,
    boost::asio::basic_streambuf<Allocator>& b,
    CompletionCondition completion_condition)
{
  return read(s, basic_streambuf_ref<Allocator>(b),
      BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
}

#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
#endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
#endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)

template <typename SyncReadStream, typename DynamicBuffer_v2,
    typename CompletionCondition>
std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
    CompletionCondition completion_condition, boost::system::error_code& ec,
    typename enable_if<
      is_dynamic_buffer_v2<DynamicBuffer_v2>::value
    >::type*)
{
  DynamicBuffer_v2& b = buffers;

  ec = boost::system::error_code();
  std::size_t total_transferred = 0;
  std::size_t max_size = detail::adapt_completion_condition_result(
        completion_condition(ec, total_transferred));
  std::size_t bytes_available = std::min<std::size_t>(
        std::max<std::size_t>(512, b.capacity() - b.size()),
        std::min<std::size_t>(max_size, b.max_size() - b.size()));
  while (bytes_available > 0)
  {
    std::size_t pos = b.size();
    b.grow(bytes_available);
    std::size_t bytes_transferred = s.read_some(
        b.data(pos, bytes_available), ec);
    b.shrink(bytes_available - bytes_transferred);
    total_transferred += bytes_transferred;
    max_size = detail::adapt_completion_condition_result(
          completion_condition(ec, total_transferred));
    bytes_available = std::min<std::size_t>(
          std::max<std::size_t>(512, b.capacity() - b.size()),
          std::min<std::size_t>(max_size, b.max_size() - b.size()));
  }
  return total_transferred;
}

template <typename SyncReadStream, typename DynamicBuffer_v2>
inline std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
    typename enable_if<
      is_dynamic_buffer_v2<DynamicBuffer_v2>::value
    >::type*)
{
  boost::system::error_code ec;
  std::size_t bytes_transferred = read(s,
      BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers), transfer_all(), ec);
  boost::asio::detail::throw_error(ec, "read");
  return bytes_transferred;
}

template <typename SyncReadStream, typename DynamicBuffer_v2>
inline std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
    boost::system::error_code& ec,
    typename enable_if<
      is_dynamic_buffer_v2<DynamicBuffer_v2>::value
    >::type*)
{
  return read(s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
      transfer_all(), ec);
}

template <typename SyncReadStream, typename DynamicBuffer_v2,
    typename CompletionCondition>
inline std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
    CompletionCondition completion_condition,
    typename enable_if<
      is_dynamic_buffer_v2<DynamicBuffer_v2>::value
    >::type*)
{
  boost::system::error_code ec;
  std::size_t bytes_transferred = read(s,
      BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
      BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
  boost::asio::detail::throw_error(ec, "read");
  return bytes_transferred;
}

namespace detail
{
  template <typename AsyncReadStream, typename MutableBufferSequence,
      typename MutableBufferIterator, typename CompletionCondition,
      typename ReadHandler>
  class read_op
    : detail::base_from_completion_cond<CompletionCondition>
  {
  public:
    read_op(AsyncReadStream& stream, const MutableBufferSequence& buffers,
        CompletionCondition& completion_condition, ReadHandler& handler)
      : detail::base_from_completion_cond<
          CompletionCondition>(completion_condition),
        stream_(stream),
        buffers_(buffers),
        start_(0),
        handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
    {
    }

#if defined(BOOST_ASIO_HAS_MOVE)
    read_op(const read_op& other)
      : detail::base_from_completion_cond<CompletionCondition>(other),
        stream_(other.stream_),
        buffers_(other.buffers_),
        start_(other.start_),
        handler_(other.handler_)
    {
    }

    read_op(read_op&& other)
      : detail::base_from_completion_cond<CompletionCondition>(
          BOOST_ASIO_MOVE_CAST(detail::base_from_completion_cond<
            CompletionCondition>)(other)),
        stream_(other.stream_),
        buffers_(BOOST_ASIO_MOVE_CAST(buffers_type)(other.buffers_)),
        start_(other.start_),
        handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(other.handler_))
    {
    }
#endif // defined(BOOST_ASIO_HAS_MOVE)

    void operator()(const boost::system::error_code& ec,
        std::size_t bytes_transferred, int start = 0)
    {
      std::size_t max_size;
      switch (start_ = start)
      {
        case 1:
        max_size = this->check_for_completion(ec, buffers_.total_consumed());
        do
        {
          stream_.async_read_some(buffers_.prepare(max_size),
              BOOST_ASIO_MOVE_CAST(read_op)(*this));
          return; default:
          buffers_.consume(bytes_transferred);
          if ((!ec && bytes_transferred == 0) || buffers_.empty())
            break;
          max_size = this->check_for_completion(ec, buffers_.total_consumed());
        } while (max_size > 0);

        handler_(ec, buffers_.total_consumed());
      }
    }

  //private:
    typedef boost::asio::detail::consuming_buffers<mutable_buffer,
        MutableBufferSequence, MutableBufferIterator> buffers_type;

    AsyncReadStream& stream_;
    buffers_type buffers_;
    int start_;
    ReadHandler handler_;
  };

  template <typename AsyncReadStream, typename MutableBufferSequence,
      typename MutableBufferIterator, typename CompletionCondition,
      typename ReadHandler>
  inline void* asio_handler_allocate(std::size_t size,
      read_op<AsyncReadStream, MutableBufferSequence, MutableBufferIterator,
        CompletionCondition, ReadHandler>* this_handler)
  {
    return boost_asio_handler_alloc_helpers::allocate(
        size, this_handler->handler_);
  }

  template <typename AsyncReadStream, typename MutableBufferSequence,
      typename MutableBufferIterator, typename CompletionCondition,
      typename ReadHandler>
  inline void asio_handler_deallocate(void* pointer, std::size_t size,
      read_op<AsyncReadStream, MutableBufferSequence, MutableBufferIterator,
        CompletionCondition, ReadHandler>* this_handler)
  {
    boost_asio_handler_alloc_helpers::deallocate(
        pointer, size, this_handler->handler_);
  }

  template <typename AsyncReadStream, typename MutableBufferSequence,
      typename MutableBufferIterator, typename CompletionCondition,
      typename ReadHandler>
  inline bool asio_handler_is_continuation(
      read_op<AsyncReadStream, MutableBufferSequence, MutableBufferIterator,
        CompletionCondition, ReadHandler>* this_handler)
  {
    return this_handler->start_ == 0 ? true
      : boost_asio_handler_cont_helpers::is_continuation(
          this_handler->handler_);
  }

  template <typename Function, typename AsyncReadStream,
      typename MutableBufferSequence, typename MutableBufferIterator,
      typename CompletionCondition, typename ReadHandler>
  inline void asio_handler_invoke(Function& function,
      read_op<AsyncReadStream, MutableBufferSequence, MutableBufferIterator,
        CompletionCondition, ReadHandler>* this_handler)
  {
    boost_asio_handler_invoke_helpers::invoke(
        function, this_handler->handler_);
  }

  template <typename Function, typename AsyncReadStream,
      typename MutableBufferSequence, typename MutableBufferIterator,
      typename CompletionCondition, typename ReadHandler>
  inline void asio_handler_invoke(const Function& function,
      read_op<AsyncReadStream, MutableBufferSequence, MutableBufferIterator,
        CompletionCondition, ReadHandler>* this_handler)
  {
    boost_asio_handler_invoke_helpers::invoke(
        function, this_handler->handler_);
  }

  template <typename AsyncReadStream, typename MutableBufferSequence,
      typename MutableBufferIterator, typename CompletionCondition,
      typename ReadHandler>
  inline void start_read_buffer_sequence_op(AsyncReadStream& stream,
      const MutableBufferSequence& buffers, const MutableBufferIterator&,
      CompletionCondition& completion_condition, ReadHandler& handler)
  {
    detail::read_op<AsyncReadStream, MutableBufferSequence,
      MutableBufferIterator, CompletionCondition, ReadHandler>(
        stream, buffers, completion_condition, handler)(
          boost::system::error_code(), 0, 1);
  }

  template <typename AsyncReadStream>
  class initiate_async_read_buffer_sequence
  {
  public:
    typedef typename AsyncReadStream::executor_type executor_type;

    explicit initiate_async_read_buffer_sequence(AsyncReadStream& stream)
      : stream_(stream)
    {
    }

    executor_type get_executor() const BOOST_ASIO_NOEXCEPT
    {
      return stream_.get_executor();
    }

    template <typename ReadHandler, typename MutableBufferSequence,
        typename CompletionCondition>
    void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
        const MutableBufferSequence& buffers,
        BOOST_ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
    {
      // If you get an error on the following line it means that your handler
      // does not meet the documented type requirements for a ReadHandler.
      BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;

      non_const_lvalue<ReadHandler> handler2(handler);
      non_const_lvalue<CompletionCondition> completion_cond2(completion_cond);
      start_read_buffer_sequence_op(stream_, buffers,
          boost::asio::buffer_sequence_begin(buffers),
          completion_cond2.value, handler2.value);
    }

  private:
    AsyncReadStream& stream_;
  };
} // namespace detail

#if !defined(GENERATING_DOCUMENTATION)

template <typename AsyncReadStream, typename MutableBufferSequence,
    typename MutableBufferIterator, typename CompletionCondition,
    typename ReadHandler, typename Allocator>
struct associated_allocator<
    detail::read_op<AsyncReadStream, MutableBufferSequence,
      MutableBufferIterator, CompletionCondition, ReadHandler>,
    Allocator>
{
  typedef typename associated_allocator<ReadHandler, Allocator>::type type;

  static type get(
      const detail::read_op<AsyncReadStream, MutableBufferSequence,
        MutableBufferIterator, CompletionCondition, ReadHandler>& h,
      const Allocator& a = Allocator()) BOOST_ASIO_NOEXCEPT
  {
    return associated_allocator<ReadHandler, Allocator>::get(h.handler_, a);
  }
};

template <typename AsyncReadStream, typename MutableBufferSequence,
    typename MutableBufferIterator, typename CompletionCondition,
    typename ReadHandler, typename Executor>
struct associated_executor<
    detail::read_op<AsyncReadStream, MutableBufferSequence,
      MutableBufferIterator, CompletionCondition, ReadHandler>,
    Executor>
{
  typedef typename associated_executor<ReadHandler, Executor>::type type;

  static type get(
      const detail::read_op<AsyncReadStream, MutableBufferSequence,
        MutableBufferIterator, CompletionCondition, ReadHandler>& h,
      const Executor& ex = Executor()) BOOST_ASIO_NOEXCEPT
  {
    return associated_executor<ReadHandler, Executor>::get(h.handler_, ex);
  }
};

#endif // !defined(GENERATING_DOCUMENTATION)

template <typename AsyncReadStream,
    typename MutableBufferSequence, typename CompletionCondition,
    BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
      std::size_t)) ReadHandler>
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
    void (boost::system::error_code, std::size_t))
async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
    CompletionCondition completion_condition,
    BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
    typename enable_if<
      is_mutable_buffer_sequence<MutableBufferSequence>::value
    >::type*)
{
  return async_initiate<ReadHandler,
    void (boost::system::error_code, std::size_t)>(
      detail::initiate_async_read_buffer_sequence<AsyncReadStream>(s), handler,
      buffers, BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
}

template <typename AsyncReadStream, typename MutableBufferSequence,
    BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
      std::size_t)) ReadHandler>
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
    void (boost::system::error_code, std::size_t))
async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
    BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
    typename enable_if<
      is_mutable_buffer_sequence<MutableBufferSequence>::value
    >::type*)
{
  return async_initiate<ReadHandler,
    void (boost::system::error_code, std::size_t)>(
      detail::initiate_async_read_buffer_sequence<AsyncReadStream>(s),
      handler, buffers, transfer_all());
}

#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)

namespace detail
{
  template <typename AsyncReadStream, typename DynamicBuffer_v1,
      typename CompletionCondition, typename ReadHandler>
  class read_dynbuf_v1_op
    : detail::base_from_completion_cond<CompletionCondition>
  {
  public:
    template <typename BufferSequence>
    read_dynbuf_v1_op(AsyncReadStream& stream,
        BOOST_ASIO_MOVE_ARG(BufferSequence) buffers,
        CompletionCondition& completion_condition, ReadHandler& handler)
      : detail::base_from_completion_cond<
          CompletionCondition>(completion_condition),
        stream_(stream),
        buffers_(BOOST_ASIO_MOVE_CAST(BufferSequence)(buffers)),
        start_(0),
        total_transferred_(0),
        handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
    {
    }

#if defined(BOOST_ASIO_HAS_MOVE)
    read_dynbuf_v1_op(const read_dynbuf_v1_op& other)
      : detail::base_from_completion_cond<CompletionCondition>(other),
        stream_(other.stream_),
        buffers_(other.buffers_),
        start_(other.start_),
        total_transferred_(other.total_transferred_),
        handler_(other.handler_)
    {
    }

    read_dynbuf_v1_op(read_dynbuf_v1_op&& other)
      : detail::base_from_completion_cond<CompletionCondition>(
          BOOST_ASIO_MOVE_CAST(detail::base_from_completion_cond<
            CompletionCondition>)(other)),
        stream_(other.stream_),
        buffers_(BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(other.buffers_)),
        start_(other.start_),
        total_transferred_(other.total_transferred_),
        handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(other.handler_))
    {
    }
#endif // defined(BOOST_ASIO_HAS_MOVE)

    void operator()(const boost::system::error_code& ec,
        std::size_t bytes_transferred, int start = 0)
    {
      std::size_t max_size, bytes_available;
      switch (start_ = start)
      {
        case 1:
        max_size = this->check_for_completion(ec, total_transferred_);
        bytes_available = std::min<std::size_t>(
              std::max<std::size_t>(512,
                buffers_.capacity() - buffers_.size()),
              std::min<std::size_t>(max_size,
                buffers_.max_size() - buffers_.size()));
        for (;;)
        {
          stream_.async_read_some(buffers_.prepare(bytes_available),
              BOOST_ASIO_MOVE_CAST(read_dynbuf_v1_op)(*this));
          return; default:
          total_transferred_ += bytes_transferred;
          buffers_.commit(bytes_transferred);
          max_size = this->check_for_completion(ec, total_transferred_);
          bytes_available = std::min<std::size_t>(
                std::max<std::size_t>(512,
                  buffers_.capacity() - buffers_.size()),
                std::min<std::size_t>(max_size,
                  buffers_.max_size() - buffers_.size()));
          if ((!ec && bytes_transferred == 0) || bytes_available == 0)
            break;
        }

        handler_(ec, static_cast<const std::size_t&>(total_transferred_));
      }
    }

  //private:
    AsyncReadStream& stream_;
    DynamicBuffer_v1 buffers_;
    int start_;
    std::size_t total_transferred_;
    ReadHandler handler_;
  };

  template <typename AsyncReadStream, typename DynamicBuffer_v1,
      typename CompletionCondition, typename ReadHandler>
  inline void* asio_handler_allocate(std::size_t size,
      read_dynbuf_v1_op<AsyncReadStream, DynamicBuffer_v1,
        CompletionCondition, ReadHandler>* this_handler)
  {
    return boost_asio_handler_alloc_helpers::allocate(
        size, this_handler->handler_);
  }

  template <typename AsyncReadStream, typename DynamicBuffer_v1,
      typename CompletionCondition, typename ReadHandler>
  inline void asio_handler_deallocate(void* pointer, std::size_t size,
      read_dynbuf_v1_op<AsyncReadStream, DynamicBuffer_v1,
        CompletionCondition, ReadHandler>* this_handler)
  {
    boost_asio_handler_alloc_helpers::deallocate(
        pointer, size, this_handler->handler_);
  }

  template <typename AsyncReadStream, typename DynamicBuffer_v1,
      typename CompletionCondition, typename ReadHandler>
  inline bool asio_handler_is_continuation(
      read_dynbuf_v1_op<AsyncReadStream, DynamicBuffer_v1,
        CompletionCondition, ReadHandler>* this_handler)
  {
    return this_handler->start_ == 0 ? true
      : boost_asio_handler_cont_helpers::is_continuation(
          this_handler->handler_);
  }

  template <typename Function, typename AsyncReadStream,
      typename DynamicBuffer_v1, typename CompletionCondition,
      typename ReadHandler>
  inline void asio_handler_invoke(Function& function,
      read_dynbuf_v1_op<AsyncReadStream, DynamicBuffer_v1,
        CompletionCondition, ReadHandler>* this_handler)
  {
    boost_asio_handler_invoke_helpers::invoke(
        function, this_handler->handler_);
  }

  template <typename Function, typename AsyncReadStream,
      typename DynamicBuffer_v1, typename CompletionCondition,
      typename ReadHandler>
  inline void asio_handler_invoke(const Function& function,
      read_dynbuf_v1_op<AsyncReadStream, DynamicBuffer_v1,
        CompletionCondition, ReadHandler>* this_handler)
  {
    boost_asio_handler_invoke_helpers::invoke(
        function, this_handler->handler_);
  }

  template <typename AsyncReadStream>
  class initiate_async_read_dynbuf_v1
  {
  public:
    typedef typename AsyncReadStream::executor_type executor_type;

    explicit initiate_async_read_dynbuf_v1(AsyncReadStream& stream)
      : stream_(stream)
    {
    }

    executor_type get_executor() const BOOST_ASIO_NOEXCEPT
    {
      return stream_.get_executor();
    }

    template <typename ReadHandler, typename DynamicBuffer_v1,
        typename CompletionCondition>
    void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
        BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
        BOOST_ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
    {
      // If you get an error on the following line it means that your handler
      // does not meet the documented type requirements for a ReadHandler.
      BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;

      non_const_lvalue<ReadHandler> handler2(handler);
      non_const_lvalue<CompletionCondition> completion_cond2(completion_cond);
      read_dynbuf_v1_op<AsyncReadStream, typename decay<DynamicBuffer_v1>::type,
        CompletionCondition, typename decay<ReadHandler>::type>(
          stream_, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
            completion_cond2.value, handler2.value)(
              boost::system::error_code(), 0, 1);
    }

  private:
    AsyncReadStream& stream_;
  };
} // namespace detail

#if !defined(GENERATING_DOCUMENTATION)

template <typename AsyncReadStream, typename DynamicBuffer_v1,
    typename CompletionCondition, typename ReadHandler, typename Allocator>
struct associated_allocator<
    detail::read_dynbuf_v1_op<AsyncReadStream,
      DynamicBuffer_v1, CompletionCondition, ReadHandler>,
    Allocator>
{
  typedef typename associated_allocator<ReadHandler, Allocator>::type type;

  static type get(
      const detail::read_dynbuf_v1_op<AsyncReadStream,
        DynamicBuffer_v1, CompletionCondition, ReadHandler>& h,
      const Allocator& a = Allocator()) BOOST_ASIO_NOEXCEPT
  {
    return associated_allocator<ReadHandler, Allocator>::get(h.handler_, a);
  }
};

template <typename AsyncReadStream, typename DynamicBuffer_v1,
    typename CompletionCondition, typename ReadHandler, typename Executor>
struct associated_executor<
    detail::read_dynbuf_v1_op<AsyncReadStream,
      DynamicBuffer_v1, CompletionCondition, ReadHandler>,
    Executor>
{
  typedef typename associated_executor<ReadHandler, Executor>::type type;

  static type get(
      const detail::read_dynbuf_v1_op<AsyncReadStream,
        DynamicBuffer_v1, CompletionCondition, ReadHandler>& h,
      const Executor& ex = Executor()) BOOST_ASIO_NOEXCEPT
  {
    return associated_executor<ReadHandler, Executor>::get(h.handler_, ex);
  }
};

#endif // !defined(GENERATING_DOCUMENTATION)

template <typename AsyncReadStream, typename DynamicBuffer_v1,
    BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
      std::size_t)) ReadHandler>
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
    void (boost::system::error_code, std::size_t))
async_read(AsyncReadStream& s,
    BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
    BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
    typename enable_if<
      is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
        && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
    >::type*)
{
  return async_read(s,
      BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
      transfer_all(), BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
}

template <typename AsyncReadStream,
    typename DynamicBuffer_v1, typename CompletionCondition,
    BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
      std::size_t)) ReadHandler>
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
    void (boost::system::error_code, std::size_t))
async_read(AsyncReadStream& s,
    BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
    CompletionCondition completion_condition,
    BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
    typename enable_if<
      is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
        && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
    >::type*)
{
  return async_initiate<ReadHandler,
    void (boost::system::error_code, std::size_t)>(
      detail::initiate_async_read_dynbuf_v1<AsyncReadStream>(s),
      handler, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
      BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
}

#if !defined(BOOST_ASIO_NO_EXTENSIONS)
#if !defined(BOOST_ASIO_NO_IOSTREAM)

template <typename AsyncReadStream, typename Allocator,
    BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
      std::size_t)) ReadHandler>
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
    void (boost::system::error_code, std::size_t))
async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
    BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
{
  return async_read(s, basic_streambuf_ref<Allocator>(b),
      BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
}

template <typename AsyncReadStream,
    typename Allocator, typename CompletionCondition,
    BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
      std::size_t)) ReadHandler>
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
    void (boost::system::error_code, std::size_t))
async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
    CompletionCondition completion_condition,
    BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
{
  return async_read(s, basic_streambuf_ref<Allocator>(b),
      BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition),
      BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
}

#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
#endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
#endif // !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)

namespace detail
{
  template <typename AsyncReadStream, typename DynamicBuffer_v2,
      typename CompletionCondition, typename ReadHandler>
  class read_dynbuf_v2_op
    : detail::base_from_completion_cond<CompletionCondition>
  {
  public:
    template <typename BufferSequence>
    read_dynbuf_v2_op(AsyncReadStream& stream,
        BOOST_ASIO_MOVE_ARG(BufferSequence) buffers,
        CompletionCondition& completion_condition, ReadHandler& handler)
      : detail::base_from_completion_cond<
          CompletionCondition>(completion_condition),
        stream_(stream),
        buffers_(BOOST_ASIO_MOVE_CAST(BufferSequence)(buffers)),
        start_(0),
        total_transferred_(0),
        bytes_available_(0),
        handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
    {
    }

#if defined(BOOST_ASIO_HAS_MOVE)
    read_dynbuf_v2_op(const read_dynbuf_v2_op& other)
      : detail::base_from_completion_cond<CompletionCondition>(other),
        stream_(other.stream_),
        buffers_(other.buffers_),
        start_(other.start_),
        total_transferred_(other.total_transferred_),
        bytes_available_(other.bytes_available_),
        handler_(other.handler_)
    {
    }

    read_dynbuf_v2_op(read_dynbuf_v2_op&& other)
      : detail::base_from_completion_cond<CompletionCondition>(
          BOOST_ASIO_MOVE_CAST(detail::base_from_completion_cond<
            CompletionCondition>)(other)),
        stream_(other.stream_),
        buffers_(BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(other.buffers_)),
        start_(other.start_),
        total_transferred_(other.total_transferred_),
        bytes_available_(other.bytes_available_),
        handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(other.handler_))
    {
    }
#endif // defined(BOOST_ASIO_HAS_MOVE)

    void operator()(const boost::system::error_code& ec,
        std::size_t bytes_transferred, int start = 0)
    {
      std::size_t max_size, pos;
      switch (start_ = start)
      {
        case 1:
        max_size = this->check_for_completion(ec, total_transferred_);
        bytes_available_ = std::min<std::size_t>(
              std::max<std::size_t>(512,
                buffers_.capacity() - buffers_.size()),
              std::min<std::size_t>(max_size,
                buffers_.max_size() - buffers_.size()));
        for (;;)
        {
          pos = buffers_.size();
          buffers_.grow(bytes_available_);
          stream_.async_read_some(buffers_.data(pos, bytes_available_),
              BOOST_ASIO_MOVE_CAST(read_dynbuf_v2_op)(*this));
          return; default:
          total_transferred_ += bytes_transferred;
          buffers_.shrink(bytes_available_ - bytes_transferred);
          max_size = this->check_for_completion(ec, total_transferred_);
          bytes_available_ = std::min<std::size_t>(
                std::max<std::size_t>(512,
                  buffers_.capacity() - buffers_.size()),
                std::min<std::size_t>(max_size,
                  buffers_.max_size() - buffers_.size()));
          if ((!ec && bytes_transferred == 0) || bytes_available_ == 0)
            break;
        }

        handler_(ec, static_cast<const std::size_t&>(total_transferred_));
      }
    }

  //private:
    AsyncReadStream& stream_;
    DynamicBuffer_v2 buffers_;
    int start_;
    std::size_t total_transferred_;
    std::size_t bytes_available_;
    ReadHandler handler_;
  };

  template <typename AsyncReadStream, typename DynamicBuffer_v2,
      typename CompletionCondition, typename ReadHandler>
  inline void* asio_handler_allocate(std::size_t size,
      read_dynbuf_v2_op<AsyncReadStream, DynamicBuffer_v2,
        CompletionCondition, ReadHandler>* this_handler)
  {
    return boost_asio_handler_alloc_helpers::allocate(
        size, this_handler->handler_);
  }

  template <typename AsyncReadStream, typename DynamicBuffer_v2,
      typename CompletionCondition, typename ReadHandler>
  inline void asio_handler_deallocate(void* pointer, std::size_t size,
      read_dynbuf_v2_op<AsyncReadStream, DynamicBuffer_v2,
        CompletionCondition, ReadHandler>* this_handler)
  {
    boost_asio_handler_alloc_helpers::deallocate(
        pointer, size, this_handler->handler_);
  }

  template <typename AsyncReadStream, typename DynamicBuffer_v2,
      typename CompletionCondition, typename ReadHandler>
  inline bool asio_handler_is_continuation(
      read_dynbuf_v2_op<AsyncReadStream, DynamicBuffer_v2,
        CompletionCondition, ReadHandler>* this_handler)
  {
    return this_handler->start_ == 0 ? true
      : boost_asio_handler_cont_helpers::is_continuation(
          this_handler->handler_);
  }

  template <typename Function, typename AsyncReadStream,
      typename DynamicBuffer_v2, typename CompletionCondition,
      typename ReadHandler>
  inline void asio_handler_invoke(Function& function,
      read_dynbuf_v2_op<AsyncReadStream, DynamicBuffer_v2,
        CompletionCondition, ReadHandler>* this_handler)
  {
    boost_asio_handler_invoke_helpers::invoke(
        function, this_handler->handler_);
  }

  template <typename Function, typename AsyncReadStream,
      typename DynamicBuffer_v2, typename CompletionCondition,
      typename ReadHandler>
  inline void asio_handler_invoke(const Function& function,
      read_dynbuf_v2_op<AsyncReadStream, DynamicBuffer_v2,
        CompletionCondition, ReadHandler>* this_handler)
  {
    boost_asio_handler_invoke_helpers::invoke(
        function, this_handler->handler_);
  }

  template <typename AsyncReadStream>
  class initiate_async_read_dynbuf_v2
  {
  public:
    typedef typename AsyncReadStream::executor_type executor_type;

    explicit initiate_async_read_dynbuf_v2(AsyncReadStream& stream)
      : stream_(stream)
    {
    }

    executor_type get_executor() const BOOST_ASIO_NOEXCEPT
    {
      return stream_.get_executor();
    }

    template <typename ReadHandler, typename DynamicBuffer_v2,
        typename CompletionCondition>
    void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
        BOOST_ASIO_MOVE_ARG(DynamicBuffer_v2) buffers,
        BOOST_ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
    {
      // If you get an error on the following line it means that your handler
      // does not meet the documented type requirements for a ReadHandler.
      BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;

      non_const_lvalue<ReadHandler> handler2(handler);
      non_const_lvalue<CompletionCondition> completion_cond2(completion_cond);
      read_dynbuf_v2_op<AsyncReadStream, typename decay<DynamicBuffer_v2>::type,
        CompletionCondition, typename decay<ReadHandler>::type>(
          stream_, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
            completion_cond2.value, handler2.value)(
              boost::system::error_code(), 0, 1);
    }

  private:
    AsyncReadStream& stream_;
  };
} // namespace detail

#if !defined(GENERATING_DOCUMENTATION)

template <typename AsyncReadStream, typename DynamicBuffer_v2,
    typename CompletionCondition, typename ReadHandler, typename Allocator>
struct associated_allocator<
    detail::read_dynbuf_v2_op<AsyncReadStream,
      DynamicBuffer_v2, CompletionCondition, ReadHandler>,
    Allocator>
{
  typedef typename associated_allocator<ReadHandler, Allocator>::type type;

  static type get(
      const detail::read_dynbuf_v2_op<AsyncReadStream,
        DynamicBuffer_v2, CompletionCondition, ReadHandler>& h,
      const Allocator& a = Allocator()) BOOST_ASIO_NOEXCEPT
  {
    return associated_allocator<ReadHandler, Allocator>::get(h.handler_, a);
  }
};

template <typename AsyncReadStream, typename DynamicBuffer_v2,
    typename CompletionCondition, typename ReadHandler, typename Executor>
struct associated_executor<
    detail::read_dynbuf_v2_op<AsyncReadStream,
      DynamicBuffer_v2, CompletionCondition, ReadHandler>,
    Executor>
{
  typedef typename associated_executor<ReadHandler, Executor>::type type;

  static type get(
      const detail::read_dynbuf_v2_op<AsyncReadStream,
        DynamicBuffer_v2, CompletionCondition, ReadHandler>& h,
      const Executor& ex = Executor()) BOOST_ASIO_NOEXCEPT
  {
    return associated_executor<ReadHandler, Executor>::get(h.handler_, ex);
  }
};

#endif // !defined(GENERATING_DOCUMENTATION)

template <typename AsyncReadStream, typename DynamicBuffer_v2,
    BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
      std::size_t)) ReadHandler>
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
    void (boost::system::error_code, std::size_t))
async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
    BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
    typename enable_if<
      is_dynamic_buffer_v2<DynamicBuffer_v2>::value
    >::type*)
{
  return async_read(s,
      BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
      transfer_all(), BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
}

template <typename AsyncReadStream,
    typename DynamicBuffer_v2, typename CompletionCondition,
    BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
      std::size_t)) ReadHandler>
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
    void (boost::system::error_code, std::size_t))
async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
    CompletionCondition completion_condition,
    BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
    typename enable_if<
      is_dynamic_buffer_v2<DynamicBuffer_v2>::value
    >::type*)
{
  return async_initiate<ReadHandler,
    void (boost::system::error_code, std::size_t)>(
      detail::initiate_async_read_dynbuf_v2<AsyncReadStream>(s),
      handler, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
      BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
}

} // namespace asio
} // namespace boost

#include <boost/asio/detail/pop_options.hpp>

#endif // BOOST_ASIO_IMPL_READ_HPP


text:
var parent = require('../../actual/instance/bind');

module.exports = parent;


text:
package Indent::String;

use strict;
use warnings;

use Class::Utils qw(set_params);
use Indent::Utils qw(line_size_check);
use Readonly;

# Constants.
Readonly::Scalar my $EMPTY_STR => q{};
Readonly::Scalar my $LINE_SIZE => 79;

our $VERSION = 0.09;

# Constructor.
sub new {
	my ($class, @params) = @_;
	my $self = bless {}, $class;

	# Options.
	$self->{'line_size'} = $LINE_SIZE;
	$self->{'next_indent'} = "\t";

	# Output.
	$self->{'output_separator'} = "\n";

	# Process params.
	set_params($self, @params);

	# 'line_size' check.
	line_size_check($self);

	# Object.
	return $self;
}

# Indent text by words to line_size block size.
sub indent {
	my ($self, $data, $act_indent, $non_indent) = @_;

	# 'indent' initialization.
	if (! defined $act_indent) {
		$act_indent = $EMPTY_STR;
	}

	# If non_indent data, than return.
	if ($non_indent) {
		return $act_indent.$data;
	}

	my ($first, $second) = (undef, $act_indent.$data);
	my $last_second_length = 0;
	my @data;
	my $one = 1;
	while (length $second >= $self->{'line_size'}
		&& $second =~ /^\s*\S+\s+/ms
		&& $last_second_length != length $second) {

		# Last length of non-parsed part of data.
		$last_second_length = length $second;

		# Parse to indent length.
		($first, my $tmp) = $second
			=~ /^(.{0,$self->{'line_size'}})\s+(.*)$/msx;

		# If string is non-breakable in indent length, than parse to
		# blank char.
		if (! $first || length $first < length $act_indent
			|| $first =~ /^$act_indent\s*$/ms) {

			($first, $tmp) = $second
				=~ /^($act_indent\s*[^\s]+?)\s(.*)$/msx;
		}

		# If parsing is right.
		if ($tmp) {

			# Non-parsed part of data.
			$second = $tmp;

			# Add next_indent to string.
			if ($one == 1) {
				$act_indent .= $self->{'next_indent'};
			}
			$one = 0;
			$second = $act_indent.$second;

			# Parsed part of data to @data array.
			push @data, $first;
		}
	}

	# Add other data to @data array.
	if ($second || $second !~ /^\s*$/ms) {
		push @data, $second;
	}

	# Return as array or one line with output separator between its.
	return wantarray ? @data : join($self->{'output_separator'}, @data);
}

1;

__END__

=pod

=encoding utf8

=head1 NAME

 Indent::String - Class for text indenting.

=head1 SYNOPSIS

 use Indent::String;

 my $obj = Indent::String->new(%parameters);
 my $string = $obj->indent('text text text');
 my @data = $obj->indent('text text text');

=head1 METHODS

=head2 C<new>

 my $obj = Indent::String->new(%parameters);

Constructor.

Returns instance of object.

=over 8

=item * C<line_size>

 Sets indent line size value.
 Default value is 79.

=item * C<next_indent>

 Sets output separator between indented datas for string context.
 Default value is "\t" (tabelator).

=item * C<output_separator>

 Output separator between data in scalar context.
 Default value is "\n" (new line).

=back

=head2 C<indent>

 my $string = $obj->indent('text text text');

or

 my @data = $obj->indent('text text text');

Indent text by words to line_size block size.

 C<$act_indent> - Actual indent string. Will be in each output string.
 C<$non_indent> - Is flag for non indenting. Default is 0.

Returns string or array of data to print.

=head1 ERRORS

 new():
         From Class::Utils::set_params():
                 Unknown parameter '%s'.
         From Indent::Utils::line_size_check():
                 'line_size' parameter must be a positive number.
                         line_size => %s

=head1 EXAMPLE

 use strict;
 use warnings;

 use Indent::String;

 # Object.
 my $i = Indent::String->new(
         'line_size' => 20,
 );

 # Indent.
 print $i->indent(join(' ', ('text') x 7))."\n";

 # Output:
 # text text text text
 # <--tab->text text text

=head1 DEPENDENCIES

L<Class::Utils>,
L<Indent::Utils>,
L<Readonly>.

=head1 SEE ALSO

=over

=item L<Indent>

Class for indent handling.

=item L<Indent::Block>

Class for block indenting.

=item L<Indent::Data>

Class for data indenting.

=item L<Indent::Utils>

Utilities for Indent classes.

=item L<Indent::Word>

Class for word indenting.

=back

=head1 REPOSITORY

L<https://github.com/michal-josef-spacek/Indent>

=head1 AUTHOR

Michal Josef Špaček L<mailto:skim@cpan.org>

L<http://skim.cz>

=head1 LICENSE AND COPYRIGHT

© 2005-2021 Michal Josef Špaček

BSD 2-Clause License

=head1 VERSION

0.09

=cut


text: SELECT 'Hello world' AS message