/* soapEventBindingProxy.cpp
   Generated by gSOAP 2.7.17 from onvif.h
   Copyright(C) 2000-2010, Robert van Engelen, Genivia Inc. All Rights Reserved.
   This part of the software is released under one of the following licenses:
   GPL, the gSOAP public license, or Genivia's license for commercial use.
*/

#include "soapEventBindingProxy.h"

EventBindingProxy::EventBindingProxy()
{	EventBindingProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT);
}

EventBindingProxy::EventBindingProxy(const struct soap &_soap) : soap(_soap)
{ }

EventBindingProxy::EventBindingProxy(soap_mode iomode)
{	EventBindingProxy_init(iomode, iomode);
}

EventBindingProxy::EventBindingProxy(soap_mode imode, soap_mode omode)
{	EventBindingProxy_init(imode, omode);
}

void EventBindingProxy::EventBindingProxy_init(soap_mode imode, soap_mode omode)
{	soap_imode(this, imode);
	soap_omode(this, omode);
	soap_endpoint = NULL;
	static const struct Namespace namespaces[] =
{
	{"SOAP-ENV", "http://www.w3.org/2003/05/soap-envelope", "http://schemas.xmlsoap.org/soap/envelope/", NULL},
	{"SOAP-ENC", "http://www.w3.org/2003/05/soap-encoding", "http://schemas.xmlsoap.org/soap/encoding/", NULL},
	{"xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL},
	{"xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL},
	{"c14n", "http://www.w3.org/2001/10/xml-exc-c14n#", NULL, NULL},
	{"wsu", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", NULL, NULL},
	{"ds", "http://www.w3.org/2000/09/xmldsig#", NULL, NULL},
	{"wsse", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd", NULL},
	{"wsa5", "http://www.w3.org/2005/08/addressing", "http://schemas.xmlsoap.org/ws/2004/08/addressing", NULL},
	{"ns1", "http://schemas.xmlsoap.org/ws/2005/04/discovery", NULL, NULL},
	{"xmime", "http://tempuri.org/xmime.xsd", NULL, NULL},
	{"xop", "http://www.w3.org/2004/08/xop/include", NULL, NULL},
	{"tt", "http://www.onvif.org/ver10/schema", NULL, NULL},
	{"wsrfbf", "http://docs.oasis-open.org/wsrf/bf-2", NULL, NULL},
	{"wsa", "http://schemas.xmlsoap.org/ws/2004/08/addressing", NULL, NULL},
	{"wstop", "http://docs.oasis-open.org/wsn/t-1", NULL, NULL},
	{"wsrfr", "http://docs.oasis-open.org/wsrf/r-2", NULL, NULL},
	{"ns10", "http://www.onvif.org/ver10/network/wsdl/RemoteDiscoveryBinding", NULL, NULL},
	{"ns11", "http://www.onvif.org/ver10/network/wsdl/DiscoveryLookupBinding", NULL, NULL},
	{"tdn", "http://www.onvif.org/ver10/network/wsdl", NULL, NULL},
	{"ns2", "http://www.onvif.org/ver10/events/wsdl/PullPointSubscriptionBinding", NULL, NULL},
	{"ns3", "http://www.onvif.org/ver10/events/wsdl/EventBinding", NULL, NULL},
	{"tev", "http://www.onvif.org/ver10/events/wsdl", NULL, NULL},
	{"ns4", "http://www.onvif.org/ver10/events/wsdl/SubscriptionManagerBinding", NULL, NULL},
	{"ns5", "http://www.onvif.org/ver10/events/wsdl/NotificationProducerBinding", NULL, NULL},
	{"ns6", "http://www.onvif.org/ver10/events/wsdl/NotificationConsumerBinding", NULL, NULL},
	{"ns7", "http://www.onvif.org/ver10/events/wsdl/PullPointBinding", NULL, NULL},
	{"ns8", "http://www.onvif.org/ver10/events/wsdl/CreatePullPointBinding", NULL, NULL},
	{"ns9", "http://www.onvif.org/ver10/events/wsdl/PausableSubscriptionManagerBinding", NULL, NULL},
	{"wsnt", "http://docs.oasis-open.org/wsn/b-2", NULL, NULL},
	{"tds", "http://www.onvif.org/ver10/device/wsdl", NULL, NULL},
	{"timg", "http://www.onvif.org/ver20/imaging/wsdl", NULL, NULL},
	{"tls", "http://www.onvif.org/ver10/display/wsdl", NULL, NULL},
	{"tmd", "http://www.onvif.org/ver10/deviceIO/wsdl", NULL, NULL},
	{"tptz", "http://www.onvif.org/ver20/ptz/wsdl", NULL, NULL},
	{"trc", "http://www.onvif.org/ver10/recording/wsdl", NULL, NULL},
	{"trp", "http://www.onvif.org/ver10/replay/wsdl", NULL, NULL},
	{"trt", "http://www.onvif.org/ver10/media/wsdl", NULL, NULL},
	{"trv", "http://www.onvif.org/ver10/receiver/wsdl", NULL, NULL},
	{"tse", "http://www.onvif.org/ver10/search/wsdl", NULL, NULL},
	{NULL, NULL, NULL, NULL}
};
	this->namespaces = namespaces;
}

EventBindingProxy::~EventBindingProxy()
{ }

void EventBindingProxy::destroy()
{	soap_destroy(this);
	soap_end(this);
}

void EventBindingProxy::soap_noheader()
{	header = NULL;
}

void EventBindingProxy::soap_header(char *wsa__MessageID, struct wsa__Relationship *wsa__RelatesTo, struct wsa__EndpointReferenceType *wsa__From, struct wsa__EndpointReferenceType *wsa__ReplyTo, struct wsa__EndpointReferenceType *wsa__FaultTo, char *wsa__To, char *wsa__Action, struct _wsse__Security *wsse__Security, char *wsa5__MessageID, struct wsa5__RelatesToType *wsa5__RelatesTo, struct wsa5__EndpointReferenceType *wsa5__From, struct wsa5__EndpointReferenceType *wsa5__ReplyTo, struct wsa5__EndpointReferenceType *wsa5__FaultTo, char *wsa5__To, char *wsa5__Action)
{	::soap_header(this);
	this->header->wsa__MessageID = wsa__MessageID;
	this->header->wsa__RelatesTo = wsa__RelatesTo;
	this->header->wsa__From = wsa__From;
	this->header->wsa__ReplyTo = wsa__ReplyTo;
	this->header->wsa__FaultTo = wsa__FaultTo;
	this->header->wsa__To = wsa__To;
	this->header->wsa__Action = wsa__Action;
	this->header->wsse__Security = wsse__Security;
	this->header->wsa5__MessageID = wsa5__MessageID;
	this->header->wsa5__RelatesTo = wsa5__RelatesTo;
	this->header->wsa5__From = wsa5__From;
	this->header->wsa5__ReplyTo = wsa5__ReplyTo;
	this->header->wsa5__FaultTo = wsa5__FaultTo;
	this->header->wsa5__To = wsa5__To;
	this->header->wsa5__Action = wsa5__Action;
}

const SOAP_ENV__Header *EventBindingProxy::soap_header()
{	return this->header;
}

const SOAP_ENV__Fault *EventBindingProxy::soap_fault()
{	return this->fault;
}

const char *EventBindingProxy::soap_fault_string()
{	return *soap_faultstring(this);
}

const char *EventBindingProxy::soap_fault_detail()
{	return *soap_faultdetail(this);
}

int EventBindingProxy::soap_close_socket()
{	return soap_closesock(this);
}

void EventBindingProxy::soap_print_fault(FILE *fd)
{	::soap_print_fault(this, fd);
}

#ifndef WITH_LEAN
void EventBindingProxy::soap_stream_fault(std::ostream& os)
{	::soap_stream_fault(this, os);
}

char *EventBindingProxy::soap_sprint_fault(char *buf, size_t len)
{	return ::soap_sprint_fault(this, buf, len);
}
#endif

int EventBindingProxy::GetServiceCapabilities(_tev__GetServiceCapabilities *tev__GetServiceCapabilities, _tev__GetServiceCapabilitiesResponse *tev__GetServiceCapabilitiesResponse)
{	struct soap *soap = this;
	struct __ns3__GetServiceCapabilities soap_tmp___ns3__GetServiceCapabilities;
	const char *soap_action = NULL;
	soap_action = "http://www.onvif.org/ver10/events/wsdl/EventPortType/GetServiceCapabilities";
	soap->encodingStyle = NULL;
	soap_tmp___ns3__GetServiceCapabilities.tev__GetServiceCapabilities = tev__GetServiceCapabilities;
	soap_begin(soap);
	soap_serializeheader(soap);
	soap_serialize___ns3__GetServiceCapabilities(soap, &soap_tmp___ns3__GetServiceCapabilities);
	if (soap_begin_count(soap))
		return soap->error;
	if (soap->mode & SOAP_IO_LENGTH)
	{	if (soap_envelope_begin_out(soap)
		 || soap_putheader(soap)
		 || soap_body_begin_out(soap)
		 || soap_put___ns3__GetServiceCapabilities(soap, &soap_tmp___ns3__GetServiceCapabilities, "-ns3:GetServiceCapabilities", NULL)
		 || soap_body_end_out(soap)
		 || soap_envelope_end_out(soap))
			 return soap->error;
	}
	if (soap_end_count(soap))
		return soap->error;
	if (soap_connect(soap, soap_endpoint, soap_action)
	 || soap_envelope_begin_out(soap)
	 || soap_putheader(soap)
	 || soap_body_begin_out(soap)
	 || soap_put___ns3__GetServiceCapabilities(soap, &soap_tmp___ns3__GetServiceCapabilities, "-ns3:GetServiceCapabilities", NULL)
	 || soap_body_end_out(soap)
	 || soap_envelope_end_out(soap)
	 || soap_end_send(soap))
		return soap_closesock(soap);
	if (!tev__GetServiceCapabilitiesResponse)
		return soap_closesock(soap);
	tev__GetServiceCapabilitiesResponse->soap_default(soap);
	if (soap_begin_recv(soap)
	 || soap_envelope_begin_in(soap)
	 || soap_recv_header(soap)
	 || soap_body_begin_in(soap))
		return soap_closesock(soap);
	tev__GetServiceCapabilitiesResponse->soap_get(soap, "tev:GetServiceCapabilitiesResponse", "");
	if (soap->error)
		return soap_recv_fault(soap, 0);
	if (soap_body_end_in(soap)
	 || soap_envelope_end_in(soap)
	 || soap_end_recv(soap))
		return soap_closesock(soap);
	return soap_closesock(soap);
}

int EventBindingProxy::CreatePullPointSubscription(_tev__CreatePullPointSubscription *tev__CreatePullPointSubscription, _tev__CreatePullPointSubscriptionResponse *tev__CreatePullPointSubscriptionResponse)
{	struct soap *soap = this;
	struct __ns3__CreatePullPointSubscription soap_tmp___ns3__CreatePullPointSubscription;
	const char *soap_action = NULL;
	soap_action = "http://www.onvif.org/ver10/events/wsdl/EventPortType/CreatePullPointSubscriptionRequest";
	soap->encodingStyle = NULL;
	soap_tmp___ns3__CreatePullPointSubscription.tev__CreatePullPointSubscription = tev__CreatePullPointSubscription;
	soap_begin(soap);
	soap_serializeheader(soap);
	soap_serialize___ns3__CreatePullPointSubscription(soap, &soap_tmp___ns3__CreatePullPointSubscription);
	if (soap_begin_count(soap))
		return soap->error;
	if (soap->mode & SOAP_IO_LENGTH)
	{	if (soap_envelope_begin_out(soap)
		 || soap_putheader(soap)
		 || soap_body_begin_out(soap)
		 || soap_put___ns3__CreatePullPointSubscription(soap, &soap_tmp___ns3__CreatePullPointSubscription, "-ns3:CreatePullPointSubscription", NULL)
		 || soap_body_end_out(soap)
		 || soap_envelope_end_out(soap))
			 return soap->error;
	}
	if (soap_end_count(soap))
		return soap->error;
	if (soap_connect(soap, soap_endpoint, soap_action)
	 || soap_envelope_begin_out(soap)
	 || soap_putheader(soap)
	 || soap_body_begin_out(soap)
	 || soap_put___ns3__CreatePullPointSubscription(soap, &soap_tmp___ns3__CreatePullPointSubscription, "-ns3:CreatePullPointSubscription", NULL)
	 || soap_body_end_out(soap)
	 || soap_envelope_end_out(soap)
	 || soap_end_send(soap))
		return soap_closesock(soap);
	if (!tev__CreatePullPointSubscriptionResponse)
		return soap_closesock(soap);
	tev__CreatePullPointSubscriptionResponse->soap_default(soap);
	if (soap_begin_recv(soap)
	 || soap_envelope_begin_in(soap)
	 || soap_recv_header(soap)
	 || soap_body_begin_in(soap))
		return soap_closesock(soap);
	tev__CreatePullPointSubscriptionResponse->soap_get(soap, "tev:CreatePullPointSubscriptionResponse", "");
	if (soap->error)
		return soap_recv_fault(soap, 0);
	if (soap_body_end_in(soap)
	 || soap_envelope_end_in(soap)
	 || soap_end_recv(soap))
		return soap_closesock(soap);
	return soap_closesock(soap);
}

int EventBindingProxy::GetEventProperties(_tev__GetEventProperties *tev__GetEventProperties, _tev__GetEventPropertiesResponse *tev__GetEventPropertiesResponse)
{	struct soap *soap = this;
	struct __ns3__GetEventProperties soap_tmp___ns3__GetEventProperties;
	const char *soap_action = NULL;
	soap_action = "http://www.onvif.org/ver10/events/wsdl/EventPortType/GetEventPropertiesRequest";
	soap->encodingStyle = NULL;
	soap_tmp___ns3__GetEventProperties.tev__GetEventProperties = tev__GetEventProperties;
	soap_begin(soap);
	soap_serializeheader(soap);
	soap_serialize___ns3__GetEventProperties(soap, &soap_tmp___ns3__GetEventProperties);
	if (soap_begin_count(soap))
		return soap->error;
	if (soap->mode & SOAP_IO_LENGTH)
	{	if (soap_envelope_begin_out(soap)
		 || soap_putheader(soap)
		 || soap_body_begin_out(soap)
		 || soap_put___ns3__GetEventProperties(soap, &soap_tmp___ns3__GetEventProperties, "-ns3:GetEventProperties", NULL)
		 || soap_body_end_out(soap)
		 || soap_envelope_end_out(soap))
			 return soap->error;
	}
	if (soap_end_count(soap))
		return soap->error;
	if (soap_connect(soap, soap_endpoint, soap_action)
	 || soap_envelope_begin_out(soap)
	 || soap_putheader(soap)
	 || soap_body_begin_out(soap)
	 || soap_put___ns3__GetEventProperties(soap, &soap_tmp___ns3__GetEventProperties, "-ns3:GetEventProperties", NULL)
	 || soap_body_end_out(soap)
	 || soap_envelope_end_out(soap)
	 || soap_end_send(soap))
		return soap_closesock(soap);
	if (!tev__GetEventPropertiesResponse)
		return soap_closesock(soap);
	tev__GetEventPropertiesResponse->soap_default(soap);
	if (soap_begin_recv(soap)
	 || soap_envelope_begin_in(soap)
	 || soap_recv_header(soap)
	 || soap_body_begin_in(soap))
		return soap_closesock(soap);
	tev__GetEventPropertiesResponse->soap_get(soap, "tev:GetEventPropertiesResponse", "");
	if (soap->error)
		return soap_recv_fault(soap, 0);
	if (soap_body_end_in(soap)
	 || soap_envelope_end_in(soap)
	 || soap_end_recv(soap))
		return soap_closesock(soap);
	return soap_closesock(soap);
}
/* End of client proxy code */


#ifndef __INC_ENDIANFREE_H
#define __INC_ENDIANFREE_H

/*
 *	Call endian free function when
 *		1. Read/write packet content.
 *		2. Before write integer to IO.
 *		3. After read integer from IO.
 */

#define __MACHINE_LITTLE_ENDIAN 1234    /* LSB first: i386, vax */
#define __MACHINE_BIG_ENDIAN    4321    /* MSB first: 68000, ibm, net, ppc */

#define BYTE_ORDER __MACHINE_LITTLE_ENDIAN

#if BYTE_ORDER == __MACHINE_LITTLE_ENDIAN
// Convert data
#define EF1Byte(_val)				((u8)(_val))
#define EF2Byte(_val)				((u16)(_val))
#define EF4Byte(_val)				((u32)(_val))

#else
// Convert data
#define EF1Byte(_val)				((u8)(_val))
#define EF2Byte(_val)				(((((u16)(_val))&0x00ff)<<8)|((((u16)(_val))&0xff00)>>8))
#define EF4Byte(_val)				(((((u32)(_val))&0x000000ff)<<24)|\
						((((u32)(_val))&0x0000ff00)<<8)|\
						((((u32)(_val))&0x00ff0000)>>8)|\
						((((u32)(_val))&0xff000000)>>24))
#endif

// Read data from memory
#define ReadEF1Byte(_ptr)		EF1Byte(*((u8 *)(_ptr)))
#define ReadEF2Byte(_ptr)		EF2Byte(*((u16 *)(_ptr)))
#define ReadEF4Byte(_ptr)		EF4Byte(*((u32 *)(_ptr)))

// Write data to memory
#define WriteEF1Byte(_ptr, _val)	(*((u8 *)(_ptr)))=EF1Byte(_val)
#define WriteEF2Byte(_ptr, _val)	(*((u16 *)(_ptr)))=EF2Byte(_val)
#define WriteEF4Byte(_ptr, _val)	(*((u32 *)(_ptr)))=EF4Byte(_val)
// Convert Host system specific byte ording (litten or big endia) to Network byte ording (big endian).
// 2006.05.07, by rcnjko.
#if BYTE_ORDER == __MACHINE_LITTLE_ENDIAN
#define H2N1BYTE(_val)	((u8)(_val))
#define H2N2BYTE(_val)	(((((u16)(_val))&0x00ff)<<8)|\
			((((u16)(_val))&0xff00)>>8))
#define H2N4BYTE(_val)	(((((u32)(_val))&0x000000ff)<<24)|\
			((((u32)(_val))&0x0000ff00)<<8)	|\
			((((u32)(_val))&0x00ff0000)>>8)	|\
			((((u32)(_val))&0xff000000)>>24))
#else
#define H2N1BYTE(_val)			((u8)(_val))
#define H2N2BYTE(_val)			((u16)(_val))
#define H2N4BYTE(_val)			((u32)(_val))
#endif

// Convert from Network byte ording (big endian) to Host system specific byte ording (litten or big endia).
// 2006.05.07, by rcnjko.
#if BYTE_ORDER == __MACHINE_LITTLE_ENDIAN
#define N2H1BYTE(_val)	((u8)(_val))
#define N2H2BYTE(_val)	(((((u16)(_val))&0x00ff)<<8)|\
			((((u16)(_val))&0xff00)>>8))
#define N2H4BYTE(_val)	(((((u32)(_val))&0x000000ff)<<24)|\
			((((u32)(_val))&0x0000ff00)<<8)	|\
			((((u32)(_val))&0x00ff0000)>>8)	|\
			((((u32)(_val))&0xff000000)>>24))
#else
#define N2H1BYTE(_val)			((u8)(_val))
#define N2H2BYTE(_val)			((u16)(_val))
#define N2H4BYTE(_val)			((u32)(_val))
#endif

//
//	Example:
//		BIT_LEN_MASK_32(0) => 0x00000000
//		BIT_LEN_MASK_32(1) => 0x00000001
//		BIT_LEN_MASK_32(2) => 0x00000003
//		BIT_LEN_MASK_32(32) => 0xFFFFFFFF
//
#define BIT_LEN_MASK_32(__BitLen) (0xFFFFFFFF >> (32 - (__BitLen)))
//
//	Example:
//		BIT_OFFSET_LEN_MASK_32(0, 2) => 0x00000003
//		BIT_OFFSET_LEN_MASK_32(16, 2) => 0x00030000
//
#define BIT_OFFSET_LEN_MASK_32(__BitOffset, __BitLen) (BIT_LEN_MASK_32(__BitLen) << (__BitOffset))

//
//	Description:
//		Return 4-byte value in host byte ordering from
//		4-byte pointer in litten-endian system.
//
#define LE_P4BYTE_TO_HOST_4BYTE(__pStart) (EF4Byte(*((u32 *)(__pStart))))

//
//	Description:
//		Translate subfield (continuous bits in little-endian) of 4-byte value in litten byte to
//		4-byte value in host byte ordering.
//
#define LE_BITS_TO_4BYTE(__pStart, __BitOffset, __BitLen) \
	( \
	  ( LE_P4BYTE_TO_HOST_4BYTE(__pStart) >> (__BitOffset) ) \
	  & \
	  BIT_LEN_MASK_32(__BitLen) \
	)

//
//	Description:
//		Mask subfield (continuous bits in little-endian) of 4-byte value in litten byte oredering
//		and return the result in 4-byte value in host byte ordering.
//
#define LE_BITS_CLEARED_TO_4BYTE(__pStart, __BitOffset, __BitLen) \
	( \
	  LE_P4BYTE_TO_HOST_4BYTE(__pStart) \
	  & \
	  ( ~BIT_OFFSET_LEN_MASK_32(__BitOffset, __BitLen) ) \
	)

//
//	Description:
//		Set subfield of little-endian 4-byte value to specified value.
//
#define SET_BITS_TO_LE_4BYTE(__pStart, __BitOffset, __BitLen, __Value) \
	*((u32 *)(__pStart)) = \
	EF4Byte( \
	LE_BITS_CLEARED_TO_4BYTE(__pStart, __BitOffset, __BitLen) \
	| \
	( (((u32)__Value) & BIT_LEN_MASK_32(__BitLen)) << (__BitOffset) ) \
       );

#define BIT_LEN_MASK_16(__BitLen) \
	(0xFFFF >> (16 - (__BitLen)))

#define BIT_OFFSET_LEN_MASK_16(__BitOffset, __BitLen) \
	(BIT_LEN_MASK_16(__BitLen) << (__BitOffset))

#define LE_P2BYTE_TO_HOST_2BYTE(__pStart) \
	(EF2Byte(*((u16 *)(__pStart))))

#define LE_BITS_TO_2BYTE(__pStart, __BitOffset, __BitLen) \
	( \
	  ( LE_P2BYTE_TO_HOST_2BYTE(__pStart) >> (__BitOffset) ) \
	  & \
	  BIT_LEN_MASK_16(__BitLen) \
	)

#define LE_BITS_CLEARED_TO_2BYTE(__pStart, __BitOffset, __BitLen) \
	( \
	  LE_P2BYTE_TO_HOST_2BYTE(__pStart) \
	  & \
	  ( ~BIT_OFFSET_LEN_MASK_16(__BitOffset, __BitLen) ) \
	)

#define SET_BITS_TO_LE_2BYTE(__pStart, __BitOffset, __BitLen, __Value) \
	*((u16 *)(__pStart)) = \
	EF2Byte( \
		LE_BITS_CLEARED_TO_2BYTE(__pStart, __BitOffset, __BitLen) \
		| \
		( (((u16)__Value) & BIT_LEN_MASK_16(__BitLen)) << (__BitOffset) ) \
       );

#define BIT_LEN_MASK_8(__BitLen) \
	(0xFF >> (8 - (__BitLen)))

#define BIT_OFFSET_LEN_MASK_8(__BitOffset, __BitLen) \
	(BIT_LEN_MASK_8(__BitLen) << (__BitOffset))

#define LE_P1BYTE_TO_HOST_1BYTE(__pStart) \
	(EF1Byte(*((u8 *)(__pStart))))

#define LE_BITS_TO_1BYTE(__pStart, __BitOffset, __BitLen) \
	( \
	  ( LE_P1BYTE_TO_HOST_1BYTE(__pStart) >> (__BitOffset) ) \
	  & \
	  BIT_LEN_MASK_8(__BitLen) \
	)

#define LE_BITS_CLEARED_TO_1BYTE(__pStart, __BitOffset, __BitLen) \
	( \
	  LE_P1BYTE_TO_HOST_1BYTE(__pStart) \
	  & \
	  ( ~BIT_OFFSET_LEN_MASK_8(__BitOffset, __BitLen) ) \
	)

#define SET_BITS_TO_LE_1BYTE(__pStart, __BitOffset, __BitLen, __Value) \
	*((u8 *)(__pStart)) = \
	EF1Byte( \
		LE_BITS_CLEARED_TO_1BYTE(__pStart, __BitOffset, __BitLen) \
		| \
		( (((u8)__Value) & BIT_LEN_MASK_8(__BitLen)) << (__BitOffset) ) \
       );

#endif // #ifndef __INC_ENDIANFREE_H


/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *

 * http://www.apache.org/licenses/LICENSE-2.0
 *

 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.hadoop.hdfs;

import org.apache.hadoop.hdfs.server.namenode.NameNode;

import java.io.IOException;

public class ListingBenchmark {

  public static void main(String[] args) throws IOException {
    HdfsConfiguration conf = new HdfsConfiguration();
    MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf)
        .numDataNodes(0)
        .format(true)
        .build();
    NameNode nn = cluster.getNameNode();
  }
}


// +build go1.6

// Copyright 2014 Unknwon
//
// Licensed under the Apache License, Version 2.0 (the "License"): you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.

// Package ini provides INI file read and write functionality in Go.
package ini

import (
	"os"
	"regexp"
	"runtime"
	"strings"
)

const (
	// DefaultSection is the name of default section. You can use this constant or the string literal.
	// In most of cases, an empty string is all you need to access the section.
	DefaultSection = "DEFAULT"

	// Maximum allowed depth when recursively substituing variable names.
	depthValues = 99
)

var (
	// LineBreak is the delimiter to determine or compose a new line.
	// This variable will be changed to "\r\n" automatically on Windows at package init time.
	LineBreak = "\n"

	// Variable regexp pattern: %(variable)s
	varPattern = regexp.MustCompile(`%\(([^)]+)\)s`)

	// DefaultHeader explicitly writes default section header.
	DefaultHeader = false

	// PrettySection indicates whether to put a line between sections.
	PrettySection = true
	// PrettyFormat indicates whether to align "=" sign with spaces to produce pretty output
	// or reduce all possible spaces for compact format.
	PrettyFormat = true
	// PrettyEqual places spaces around "=" sign even when PrettyFormat is false.
	PrettyEqual = false
	// DefaultFormatLeft places custom spaces on the left when PrettyFormat and PrettyEqual are both disabled.
	DefaultFormatLeft = ""
	// DefaultFormatRight places custom spaces on the right when PrettyFormat and PrettyEqual are both disabled.
	DefaultFormatRight = ""
)

var inTest = len(os.Args) > 0 && strings.HasSuffix(strings.TrimSuffix(os.Args[0], ".exe"), ".test")

func init() {
	if runtime.GOOS == "windows" && !inTest {
		LineBreak = "\r\n"
	}
}

// LoadOptions contains all customized options used for load data source(s).
type LoadOptions struct {
	// Loose indicates whether the parser should ignore nonexistent files or return error.
	Loose bool
	// Insensitive indicates whether the parser forces all section and key names to lowercase.
	Insensitive bool
	// InsensitiveSections indicates whether the parser forces all section to lowercase.
	InsensitiveSections bool
	// InsensitiveKeys indicates whether the parser forces all key names to lowercase.
	InsensitiveKeys bool
	// IgnoreContinuation indicates whether to ignore continuation lines while parsing.
	IgnoreContinuation bool
	// IgnoreInlineComment indicates whether to ignore comments at the end of value and treat it as part of value.
	IgnoreInlineComment bool
	// SkipUnrecognizableLines indicates whether to skip unrecognizable lines that do not conform to key/value pairs.
	SkipUnrecognizableLines bool
	// ShortCircuit indicates whether to ignore other configuration sources after loaded the first available configuration source.
	ShortCircuit bool
	// AllowBooleanKeys indicates whether to allow boolean type keys or treat as value is missing.
	// This type of keys are mostly used in my.cnf.
	AllowBooleanKeys bool
	// AllowShadows indicates whether to keep track of keys with same name under same section.
	AllowShadows bool
	// AllowNestedValues indicates whether to allow AWS-like nested values.
	// Docs: http://docs.aws.amazon.com/cli/latest/topic/config-vars.html#nested-values
	AllowNestedValues bool
	// AllowPythonMultilineValues indicates whether to allow Python-like multi-line values.
	// Docs: https://docs.python.org/3/library/configparser.html#supported-ini-file-structure
	// Relevant quote:  Values can also span multiple lines, as long as they are indented deeper
	// than the first line of the value.
	AllowPythonMultilineValues bool
	// SpaceBeforeInlineComment indicates whether to allow comment symbols (\# and \;) inside value.
	// Docs: https://docs.python.org/2/library/configparser.html
	// Quote: Comments may appear on their own in an otherwise empty line, or may be entered in lines holding values or section names.
	// In the latter case, they need to be preceded by a whitespace character to be recognized as a comment.
	SpaceBeforeInlineComment bool
	// UnescapeValueDoubleQuotes indicates whether to unescape double quotes inside value to regular format
	// when value is surrounded by double quotes, e.g. key="a \"value\"" => key=a "value"
	UnescapeValueDoubleQuotes bool
	// UnescapeValueCommentSymbols indicates to unescape comment symbols (\# and \;) inside value to regular format
	// when value is NOT surrounded by any quotes.
	// Note: UNSTABLE, behavior might change to only unescape inside double quotes but may noy necessary at all.
	UnescapeValueCommentSymbols bool
	// UnparseableSections stores a list of blocks that are allowed with raw content which do not otherwise
	// conform to key/value pairs. Specify the names of those blocks here.
	UnparseableSections []string
	// KeyValueDelimiters is the sequence of delimiters that are used to separate key and value. By default, it is "=:".
	KeyValueDelimiters string
	// KeyValueDelimiters is the delimiter that are used to separate key and value output. By default, it is "=".
	KeyValueDelimiterOnWrite string
	// ChildSectionDelimiter is the delimiter that is used to separate child sections. By default, it is ".".
	ChildSectionDelimiter string
	// PreserveSurroundedQuote indicates whether to preserve surrounded quote (single and double quotes).
	PreserveSurroundedQuote bool
	// DebugFunc is called to collect debug information (currently only useful to debug parsing Python-style multiline values).
	DebugFunc DebugFunc
	// ReaderBufferSize is the buffer size of the reader in bytes.
	ReaderBufferSize int
	// AllowNonUniqueSections indicates whether to allow sections with the same name multiple times.
	AllowNonUniqueSections bool
}

// DebugFunc is the type of function called to log parse events.
type DebugFunc func(message string)

// LoadSources allows caller to apply customized options for loading from data source(s).
func LoadSources(opts LoadOptions, source interface{}, others ...interface{}) (_ *File, err error) {
	sources := make([]dataSource, len(others)+1)
	sources[0], err = parseDataSource(source)
	if err != nil {
		return nil, err
	}
	for i := range others {
		sources[i+1], err = parseDataSource(others[i])
		if err != nil {
			return nil, err
		}
	}
	f := newFile(sources, opts)
	if err = f.Reload(); err != nil {
		return nil, err
	}
	return f, nil
}

// Load loads and parses from INI data sources.
// Arguments can be mixed of file name with string type, or raw data in []byte.
// It will return error if list contains nonexistent files.
func Load(source interface{}, others ...interface{}) (*File, error) {
	return LoadSources(LoadOptions{}, source, others...)
}

// LooseLoad has exactly same functionality as Load function
// except it ignores nonexistent files instead of returning error.
func LooseLoad(source interface{}, others ...interface{}) (*File, error) {
	return LoadSources(LoadOptions{Loose: true}, source, others...)
}

// InsensitiveLoad has exactly same functionality as Load function
// except it forces all section and key names to be lowercased.
func InsensitiveLoad(source interface{}, others ...interface{}) (*File, error) {
	return LoadSources(LoadOptions{Insensitive: true}, source, others...)
}

// ShadowLoad has exactly same functionality as Load function
// except it allows have shadow keys.
func ShadowLoad(source interface{}, others ...interface{}) (*File, error) {
	return LoadSources(LoadOptions{AllowShadows: true}, source, others...)
}


/* v850.h -- Header file for NEC V850 opcode table
   Copyright 1996-2013 Free Software Foundation, Inc.
   Written by J.T. Conklin, Cygnus Support

   This file is part of GDB, GAS, and the GNU binutils.

   GDB, GAS, and the GNU binutils are free software; you can redistribute
   them and/or modify them under the terms of the GNU General Public
   License as published by the Free Software Foundation; either version 3,
   or (at your option) any later version.

   GDB, GAS, and the GNU binutils are distributed in the hope that they
   will be useful, but WITHOUT ANY WARRANTY; without even the implied
   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
   the GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this file; see the file COPYING3.  If not, write to the Free
   Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
   MA 02110-1301, USA.  */

#ifndef V850_H
#define V850_H

/* The opcode table is an array of struct v850_opcode.  */

struct v850_opcode
{
  /* The opcode name.  */
  const char *name;

  /* The opcode itself.  Those bits which will be filled in with
     operands are zeroes.  */
  unsigned long opcode;

  /* The opcode mask.  This is used by the disassembler.  This is a
     mask containing ones indicating those bits which must match the
     opcode field, and zeroes indicating those bits which need not
     match (and are presumably filled in by operands).  */
  unsigned long mask;

  /* An array of operand codes.  Each code is an index into the
     operand table.  They appear in the order which the operands must
     appear in assembly code, and are terminated by a zero.  */
  unsigned char operands[8];

  /* Which (if any) operand is a memory operand.  */
  unsigned int memop;

  /* Target processor(s).  A bit field of processors which support
     this instruction.  Note a bit field is used as some instructions
     are available on multiple, different processor types, whereas
     other instructions are only available on one specific type.  */
  unsigned int processors;
};

/* Values for architecture number.  */
#define arch_V850      0
#define arch_V850E     (arch_V850 + 1)
#define arch_V850E1    (arch_V850E + 1)
#define arch_V850E2    (arch_V850E1 + 1)
#define arch_V850E2V3  (arch_V850E2 + 1)
#define arch_V850E3V5  (arch_V850E2V3 + 1)
#define arch_separator (arch_V850E3V5 + 1)

#define opt_EXTENSION  (arch_separator)
#define opt_ALIAS      (opt_EXTENSION + 1)

/* Values for the processors field in the v850_opcode structure.  */
#define PROCESSOR_V850       (1 << (arch_V850))     /* Just the V850.  */
#define PROCESSOR_V850E      (1 << (arch_V850E))    /* Just the V850E.  */
#define PROCESSOR_V850E1     (1 << (arch_V850E1))   /* Just the V850E1.  */
#define PROCESSOR_V850E2     (1 << (arch_V850E2))   /* Just the V850E2.  */
#define PROCESSOR_V850E2V3   (1 << (arch_V850E2V3)) /* Just the V850E2V3.  */
#define PROCESSOR_V850E3V5   (1 << (arch_V850E3V5)) /* Just the V850E3V5.  */

/* UPPERS */
#define PROCESSOR_V850E3V5_UP (PROCESSOR_V850E3V5)
#define PROCESSOR_V850E2V3_UP (PROCESSOR_V850E2V3 | PROCESSOR_V850E3V5_UP)
#define PROCESSOR_V850E2_UP   (PROCESSOR_V850E2   | PROCESSOR_V850E2V3_UP)
#define PROCESSOR_V850E_UP    (PROCESSOR_V850E    | PROCESSOR_V850E1 | PROCESSOR_V850E2_UP)
#define PROCESSOR_ALL         (PROCESSOR_V850     | PROCESSOR_V850E_UP)

#define PROCESSOR_MASK        (PROCESSOR_ALL)
#define PROCESSOR_NOT_V850    (PROCESSOR_ALL & (~ PROCESSOR_V850))         /* Any processor except the V850.  */

#define PROCESSOR_UNKNOWN    ~(PROCESSOR_MASK)

/* OPTIONS */
#define PROCESSOR_OPTION_EXTENSION (1 << (opt_EXTENSION))                  /* Enable extension opcodes.  */
#define PROCESSOR_OPTION_ALIAS     (1 << (opt_ALIAS))                      /* Enable alias opcodes.  */

#define SET_PROCESSOR_MASK(mask,set)	((mask) = ((mask) & ~PROCESSOR_MASK) | (set))

/* The table itself is sorted by major opcode number, and is otherwise
   in the order in which the disassembler should consider
   instructions.  */
extern const struct v850_opcode v850_opcodes[];
extern const int v850_num_opcodes;

/* The operands table is an array of struct v850_operand.  */

struct v850_operand
{
  /* The number of bits in the operand.  */
  /* If this value is -1 then the operand's bits are in a discontinous
     distribution in the instruction. */
  int bits;

  /* (bits >= 0):  How far the operand is left shifted in the instruction.  */
  /* (bits == -1): Bit mask of the bits in the operand.  */
  int shift;

  /* Insertion function.  This is used by the assembler.  To insert an
     operand value into an instruction, check this field.

     If it is NULL, execute
         i |= (op & ((1 << o->bits) - 1)) << o->shift;
     (i is the instruction which we are filling in, o is a pointer to
     this structure, and op is the opcode value; this assumes twos
     complement arithmetic).

     If this field is not NULL, then simply call it with the
     instruction and the operand value.  It will return the new value
     of the instruction.  If the ERRMSG argument is not NULL, then if
     the operand value is illegal, *ERRMSG will be set to a warning
     string (the operand will be inserted in any case).  If the
     operand value is legal, *ERRMSG will be unchanged (most operands
     can accept any value).  */
  unsigned long (* insert)
    (unsigned long instruction, long op, const char ** errmsg);

  /* Extraction function.  This is used by the disassembler.  To
     extract this operand type from an instruction, check this field.

     If it is NULL, compute
         op = o->bits == -1 ? ((i) & o->shift) : ((i) >> o->shift) & ((1 << o->bits) - 1);
	 if (o->flags & V850_OPERAND_SIGNED)
	     op = (op << (32 - o->bits)) >> (32 - o->bits);
     (i is the instruction, o is a pointer to this structure, and op
     is the result; this assumes twos complement arithmetic).

     If this field is not NULL, then simply call it with the
     instruction value.  It will return the value of the operand.  If
     the INVALID argument is not NULL, *INVALID will be set to
     non-zero if this operand type can not actually be extracted from
     this operand (i.e., the instruction does not match).  If the
     operand is valid, *INVALID will not be changed.  */
  unsigned long (* extract) (unsigned long instruction, int * invalid);

  /* One bit syntax flags.  */
  int flags;

  int default_reloc;
};

/* Elements in the table are retrieved by indexing with values from
   the operands field of the v850_opcodes table.  */

extern const struct v850_operand v850_operands[];

/* Values defined for the flags field of a struct v850_operand.  */

/* This operand names a general purpose register.  */
#define V850_OPERAND_REG	0x01

/* This operand is the ep register.  */
#define V850_OPERAND_EP		0x02

/* This operand names a system register.  */
#define V850_OPERAND_SRG	0x04

/* Prologue eilogue type instruction, V850E specific.  */
#define V850E_OPERAND_REG_LIST	0x08

/* This operand names a condition code used in the setf instruction.  */
#define V850_OPERAND_CC		0x10

#define V850_OPERAND_FLOAT_CC	0x20

/* This operand names a vector purpose register.  */
#define V850_OPERAND_VREG	0x40

/* 16 bit immediate follows instruction, V850E specific.  */
#define V850E_IMMEDIATE16	0x80

/* hi16 bit immediate follows instruction, V850E specific.  */
#define V850E_IMMEDIATE16HI	0x100

/* 23 bit immediate follows instruction, V850E specific.  */
#define V850E_IMMEDIATE23	0x200

/* 32 bit immediate follows instruction, V850E specific.  */
#define V850E_IMMEDIATE32	0x400

/* This is a relaxable operand.   Only used for D9->D22 branch relaxing
   right now.  We may need others in the future (or maybe handle them like
   promoted operands on the mn10300?).  */
#define V850_OPERAND_RELAX	0x800

/* This operand takes signed values.  */
#define V850_OPERAND_SIGNED	0x1000

/* This operand is a displacement.  */
#define V850_OPERAND_DISP	0x2000

/* This operand is a PC displacement.  */
#define V850_PCREL		0x4000

/* The register specified must be even number.  */
#define V850_REG_EVEN		0x8000

/* The register specified must not be r0.  */
#define V850_NOT_R0	        0x20000

/* The register specified must not be 0.  */
#define V850_NOT_IMM0	        0x40000

/* The condition code must not be SA CONDITION.  */
#define V850_NOT_SA		0x80000

/* The operand has '!' prefix.  */
#define V850_OPERAND_BANG	0x100000

/* The operand has '%' prefix.  */
#define V850_OPERAND_PERCENT	0x200000

/* This operand is a cache oparation.  */
#define V850_OPERAND_CACHEOP	0x400000

/* This operand is a prefetch oparation.  */
#define V850_OPERAND_PREFOP	0x800000

/* A PC-relative displacement where a positive value indicates a backwards displacement.  */
#define V850_INVERSE_PCREL	0x1000000

extern int v850_msg_is_out_of_range (const char *);

#endif /* V850_H */


package Paws::Greengrass::DisassociateServiceRoleFromAccountResponse;
  use Moose;
  has DisassociatedAt => (is => 'ro', isa => 'Str');

  has _request_id => (is => 'ro', isa => 'Str');
1;

### main pod documentation begin ###

=head1 NAME

Paws::Greengrass::DisassociateServiceRoleFromAccountResponse

=head1 ATTRIBUTES

=head2 DisassociatedAt => Str

The time when the service role was disassociated from the account.

=head2 _request_id => Str

=cut


//  Boost string_algo library find_format.hpp header file  ---------------------------//

//  Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
//    (See accompanying file LICENSE_1_0.txt or copy at
//          http://www.boost.org/LICENSE_1_0.txt)

//  See http://www.boost.org/ for updates, documentation, and revision history.

#ifndef BOOST_STRING_FIND_FORMAT_HPP
#define BOOST_STRING_FIND_FORMAT_HPP

#include <deque>
#include <boost/detail/iterator.hpp>
#include <boost/range/iterator_range_core.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/const_iterator.hpp>
#include <boost/range/as_literal.hpp>

#include <boost/algorithm/string/concept.hpp>
#include <boost/algorithm/string/detail/find_format.hpp>
#include <boost/algorithm/string/detail/find_format_all.hpp>

/*! \file
    Defines generic replace algorithms. Each algorithm replaces
    part(s) of the input. The part to be replaced is looked up using a Finder object.
    Result of finding is then used by a Formatter object to generate the replacement.
*/

namespace boost {
    namespace algorithm {

// generic replace  -----------------------------------------------------------------//

        //! Generic replace algorithm
        /*!
            Use the Finder to search for a substring. Use the Formatter to format
            this substring and replace it in the input.
            The result is a modified copy of the input. It is returned as a sequence
            or copied to the output iterator.

            \param Output An output iterator to which the result will be copied
            \param Input An input sequence
            \param Finder A Finder object used to search for a match to be replaced
            \param Formatter A Formatter object used to format a match
            \return An output iterator pointing just after the last inserted character or
                a modified copy of the input

            \note The second variant of this function provides the strong exception-safety guarantee
        */
        template<
            typename OutputIteratorT,
            typename RangeT,
            typename FinderT,
            typename FormatterT>
        inline OutputIteratorT find_format_copy(
            OutputIteratorT Output,
            const RangeT& Input,
            FinderT Finder,
            FormatterT Formatter )
        {
            // Concept check
            BOOST_CONCEPT_ASSERT((
                FinderConcept<
                    FinderT,
                    BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>
                ));
            BOOST_CONCEPT_ASSERT((
                FormatterConcept<
                    FormatterT,
                    FinderT,BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>
                ));

            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_input(::boost::as_literal(Input));

            return detail::find_format_copy_impl(
                Output,
                lit_input,
                Formatter,
                Finder( ::boost::begin(lit_input), ::boost::end(lit_input) ) );
        }

        //! Generic replace algorithm
        /*!
            \overload
        */
        template<
            typename SequenceT,
            typename FinderT,
            typename FormatterT>
        inline SequenceT find_format_copy(
            const SequenceT& Input,
            FinderT Finder,
            FormatterT Formatter )
        {
            // Concept check
            BOOST_CONCEPT_ASSERT((
                FinderConcept<
                    FinderT,
                    BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
                ));
            BOOST_CONCEPT_ASSERT((
                FormatterConcept<
                    FormatterT,
                    FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
                ));

            return detail::find_format_copy_impl(
                Input,
                Formatter,
                Finder(::boost::begin(Input), ::boost::end(Input)));
        }

        //! Generic replace algorithm
        /*!
            Use the Finder to search for a substring. Use the Formatter to format
            this substring and replace it in the input. The input is modified in-place.

            \param Input An input sequence
            \param Finder A Finder object used to search for a match to be replaced
            \param Formatter A Formatter object used to format a match
        */
        template<
            typename SequenceT,
            typename FinderT,
            typename FormatterT>
        inline void find_format(
            SequenceT& Input,
            FinderT Finder,
            FormatterT Formatter)
        {
            // Concept check
            BOOST_CONCEPT_ASSERT((
                FinderConcept<
                    FinderT,
                    BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
                ));
            BOOST_CONCEPT_ASSERT((
                FormatterConcept<
                    FormatterT,
                    FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
                ));

            detail::find_format_impl(
                Input,
                Formatter,
                Finder(::boost::begin(Input), ::boost::end(Input)));
        }

//  find_format_all generic ----------------------------------------------------------------//

        //! Generic replace all algorithm
        /*!
            Use the Finder to search for a substring. Use the Formatter to format
            this substring and replace it in the input. Repeat this for all matching
            substrings.
            The result is a modified copy of the input. It is returned as a sequence
            or copied to the output iterator.

            \param Output An output iterator to which the result will be copied
            \param Input An input sequence
            \param Finder A Finder object used to search for a match to be replaced
            \param Formatter A Formatter object used to format a match
            \return An output iterator pointing just after the last inserted character or
                a modified copy of the input

             \note The second variant of this function provides the strong exception-safety guarantee
        */
        template<
            typename OutputIteratorT,
            typename RangeT,
            typename FinderT,
            typename FormatterT>
        inline OutputIteratorT find_format_all_copy(
            OutputIteratorT Output,
            const RangeT& Input,
            FinderT Finder,
            FormatterT Formatter)
        {
            // Concept check
            BOOST_CONCEPT_ASSERT((
                FinderConcept<
                    FinderT,
                    BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>
                ));
            BOOST_CONCEPT_ASSERT((
                FormatterConcept<
                    FormatterT,
                    FinderT,BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>
                ));

            iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_input(::boost::as_literal(Input));

            return detail::find_format_all_copy_impl(
                Output,
                lit_input,
                Finder,
                Formatter,
                Finder(::boost::begin(lit_input), ::boost::end(lit_input)));
        }

        //! Generic replace all algorithm
        /*!
            \overload
        */
        template<
            typename SequenceT,
            typename FinderT,
            typename FormatterT >
        inline SequenceT find_format_all_copy(
            const SequenceT& Input,
            FinderT Finder,
            FormatterT Formatter )
        {
            // Concept check
            BOOST_CONCEPT_ASSERT((
                FinderConcept<
                    FinderT,
                    BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
                ));
            BOOST_CONCEPT_ASSERT((
                FormatterConcept<
                    FormatterT,
                    FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
                ));

            return detail::find_format_all_copy_impl(
                Input,
                Finder,
                Formatter,
                Finder( ::boost::begin(Input), ::boost::end(Input) ) );
        }

        //! Generic replace all algorithm
        /*!
            Use the Finder to search for a substring. Use the Formatter to format
            this substring and replace it in the input. Repeat this for all matching
            substrings.The input is modified in-place.

            \param Input An input sequence
            \param Finder A Finder object used to search for a match to be replaced
            \param Formatter A Formatter object used to format a match
        */
        template<
            typename SequenceT,
            typename FinderT,
            typename FormatterT >
        inline void find_format_all(
            SequenceT& Input,
            FinderT Finder,
            FormatterT Formatter )
        {
            // Concept check
            BOOST_CONCEPT_ASSERT((
                FinderConcept<
                    FinderT,
                    BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
                ));
            BOOST_CONCEPT_ASSERT((
                FormatterConcept<
                    FormatterT,
                    FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
                ));

            detail::find_format_all_impl(
                Input,
                Finder,
                Formatter,
                Finder(::boost::begin(Input), ::boost::end(Input)));

        }

    } // namespace algorithm

    // pull the names to the boost namespace
    using algorithm::find_format_copy;
    using algorithm::find_format;
    using algorithm::find_format_all_copy;
    using algorithm::find_format_all;

} // namespace boost

#endif  // BOOST_STRING_FIND_FORMAT_HPP


#> bounding circle
path: '/v1/search?text=a&boundary.circle.lat=40.744243&boundary.circle.lon=-73.990342&boundary.circle.radius=100'

#? 200 ok
response.statusCode.should.be.equal 200
response.should.have.header 'charset', 'utf8'
response.should.have.header 'content-type', 'application/json; charset=utf-8'

#? valid geocoding block
should.exist json.geocoding
should.exist json.geocoding.version
should.exist json.geocoding.attribution
should.exist json.geocoding.query
should.exist json.geocoding.engine
should.exist json.geocoding.engine.name
should.exist json.geocoding.engine.author
should.exist json.geocoding.engine.version
should.exist json.geocoding.timestamp

#? valid geojson
json.type.should.be.equal 'FeatureCollection'
json.features.should.be.instanceof Array

#? expected errors
should.not.exist json.geocoding.errors

#? expected warnings
should.not.exist json.geocoding.warnings

#? inputs
json.geocoding.query['text'].should.eql 'a'
json.geocoding.query['size'].should.eql 10
json.geocoding.query['boundary.circle.lat'].should.eql 40.744243
json.geocoding.query['boundary.circle.lon'].should.eql -73.990342
json.geocoding.query['boundary.circle.radius'].should.eql 100


# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.

from __future__ import unicode_literals

from indico.modules.events.management.views import WPEventManagement
from indico.modules.events.views import WPConferenceDisplayBase
from indico.util.mathjax import MathjaxMixin

class WPManageContributions(MathjaxMixin, WPEventManagement):
    template_prefix = 'events/contributions/'
    sidemenu_option = 'contributions'
    bundles = ('markdown.js', 'module_events.contributions.js')

    def _get_head_content(self):
        return WPEventManagement._get_head_content(self) + MathjaxMixin._get_head_content(self)

class WPContributionsDisplayBase(WPConferenceDisplayBase):
    template_prefix = 'events/contributions/'
    # 'module_events.contributions.js' is already included via WPEventBase
    bundles = ('markdown.js', 'module_events.contributions.css')

class WPMyContributions(WPContributionsDisplayBase):
    menu_entry_name = 'my_contributions'

class WPContributions(WPContributionsDisplayBase):
    menu_entry_name = 'contributions'

class WPAuthorList(WPContributionsDisplayBase):
    menu_entry_name = 'author_index'

class WPSpeakerList(WPContributionsDisplayBase):
    menu_entry_name = 'speaker_index'


var menuIds;
var permIds;
$(function() {
	getMenuTreeData();
	getPermTreeData();
	validateRule();
});
$.validator.setDefaults({
	submitHandler : function() {
		getAllSelectNodes();
		update();
	}
});
function loadMenuTree(menuTree) {
	$('#menuTree').jstree({
		"plugins" : [ "wholerow", "checkbox" ],
		'core' : {
			'data' : menuTree
		},
		"checkbox" : {
			//"keep_selected_style" : false,
			//"undetermined" : true
			//"three_state" : false,
			//"cascade" : ' up'
		}
	});
	$('#menuTree').jstree('open_all');
}
function getAllSelectNodes() {
	var ref = $('#menuTree').jstree(true); // 获得整个树
	menuIds = ref.get_selected(); // 获得所有选中节点的，返回值为数组
	$("#menuTree").find(".jstree-undetermined").each(function(i, element) {
		menuIds.push($(element).closest('.jstree-node').attr("id"));
	});
	ref = $('#dataPermTree').jstree(true); // 获得整个树

	permIds = ref.get_selected(); // 获得所有选中节点的，返回值为数组

	$("#dataPermTree").find(".jstree-undetermined").each(function(i, element) {
		permIds.push($(element).closest('.jstree-node').attr("id"));
	});
}
function getPermTreeData() {
	var roleId = $('#roleId').val();
	$.ajax({
		type : "GET",
		url : "/system/dataPerm/tree/"+roleId,
		success : function(permTree) {
			loadPermTree(permTree);
		}
	});
}
function loadPermTree(permTree) {
	$('#dataPermTree').jstree({
		'core' : {
			'data' : permTree
		},
		"checkbox" : {
			"three_state" : true,
		},
		"plugins" : [ "wholerow", "checkbox" ]
	});
	//$('#menuTree').jstree("open_all");

}
function getMenuTreeData() {
	var roleId = $('#roleId').val();
	$.ajax({
		type : "GET",
		url : "/sys/menu/tree/" + roleId,
		success : function(data) {
			loadMenuTree(data);
		}
	});
}
function update() {
	$('#menuIds').val(menuIds);
	$('#permIds').val(permIds);
	var role = $('#signupForm').serialize();
	$.ajax({
		cache : true,
		type : "POST",
		url : "/sys/role/update",
		data : role, // 你的formid
		async : false,
		error : function(request) {
			alert("Connection error");
		},
		success : function(r) {
			if (r.code == 0) {
				parent.layer.msg(r.msg);
				parent.reLoad();
				var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
				parent.layer.close(index);

			} else {
				parent.layer.msg(r.msg);
			}

		}
	});
}
function validateRule() {
	var icon = "<i class='fa fa-times-circle'></i> ";
	$("#signupForm").validate({
		rules : {
			roleName : {
				required : true
			}
		},
		messages : {
			roleName : {
				required : icon + "请输入角色名"
			}
		}
	});
}


SHA256 (Class-MethodMaker-2.24.tar.gz) = 5eef58ccb27ebd01bcde5b14bcc553b5347a0699e5c3e921c7780c3526890328
SIZE (Class-MethodMaker-2.24.tar.gz) = 77242


All dinos over 23 kg should have a zombie version to zombify into

SEES SMELLS HEARS PET_MOUNTABLE POISON STUMBLES NO_BREATHE REVIVES FILTHY WARM

The shuffling corpse of a medium-sized bipedal dinosaur covered with tattered feathers and black putrid liquid.  It looks like a reptilian ostrich with a round hard-looking domed head.

Enormous putrid dinosaur corpse with a ferocious crocodile-like head, oozing black eyes, and a tattered sail on its back.

SEES SMELLS HEARS POISON STUMBLES BASHES DESTROYS NO_BREATHE REVIVES FILTHY WARM SWIMS

Massive piles of ragged, stinking flesh lifting enormous teeth.

SEES SMELLS HEARS PET_MOUNTABLE POISON STUMBLES BASHES DESTROYS NO_BREATHE REVIVES FILTHY WARM

Massive jaws drooling black liquid lifted over grasping claws by a huge shuffling dinosaur corpse.

A massive shambling rhino-like dinosaur corpse with a tall bony crest from which four long horns and a short nose horn emerge.  Its black eyes ooze like tears.

A massive shambling rhino-like dinosaur corpse with a tall bony crest from which two wicked looking horns emerge.  Its black eyes ooze like tears.

A massive shambling rhino-like dinosaur corpse with a bony crest from which three wicked looking horns emerge.  Its black eyes ooze like tears.

A large shambling quadruped dinosaur corpse dragging with the weight of the plates on its back, waving a much livelier looking spiked tail.

The shuffling corpse of what looks like a giant armadillo with peeling armored plates and black, glistening eyes.  Its tail ends in a massive spiked club of bone.

SEES SMELLS HEARS POISON STUMBLES NO_BREATHE REVIVES FILTHY WARM BASHES

Huge, long-necked, four-legged dinosaur with a long, whip-like tail and a tiny head with vacant white eyes.  Sways and staggers.

Massive, long-necked, four-legged dinosaur corpse with a long, whip-like tail.  The head is upright and the neck looks like it would still make a good strong club.

The shambling corpse of a large predatory bipedal dinosaur, with tiger-like stripes on its broad, scaled back.

SEES SMELLS HEARS POISON STUMBLES BASHES NO_BREATHE REVIVES FILTHY WARM

The shambling corpse of a huge predatory bipedal dinosaur, with a tall ridge running down the length of its back covered with heavy muscles.  Its teeth are curved and serrated like sawblades.

The shambling corpse of a huge predatory bipedal dinosaur with long claws and strong arms for grappling.

The shuffling corpse of a medium-sized bipedal dinosaur covered with tattered feathers and black putrid liquid.  Both feet brandish a large sickle-like claw.

SEES SMELLS HEARS KEENNOSE POISON STUMBLES NO_BREATHE REVIVES FILTHY WARM

The swaying, hopping corpse of a large bipedal dinosaur with feathered arms, a long tail, and long sharp scythe-like claws.

The shuffling corpse of a large feathered bipedal dinosaur with strong legs, broad shoulders and a pointed beak.  Its tattered feathers are stained with black, sticky liquid.

A huge mottled dinosaur with hooves and heavy tail, dead and walking, eyes vacant and swollen.  Has a flat beak, thick nose, and small spiky head crest.

A huge mottled dinosaur with a blunt head crest, dead and walking, eyes vacant and swollen.

A huge scaly dinosaur with a short beak and a tall head crest, dead and walking, eyes vacant and swollen.

A huge scaly dinosaur with a broad toothless beak, dead and walking, eyes vacant and swollen.

The raggedly flying corpse of a large feathered reptile with a long pointed toothless beak and a long pointy head crest.

The raggedly flying corpse of a large feathered reptile with a long pointed toothless beak and a long rigid neck.

The shuffling corpse of a medium dinosaur with sharp teeth and two prominent bony crests on its head with ragged strips of ripped flesh hanging down like a frill.

This zombie is enormous, scaly, studded with bony spikes, and it moves with horrible speed.  Its colorful horns are worn and wet with filth and its bright scales and bone spikes have taken a beating.

SEES SMELLS HEARS BASHES POISON STUMBLES NO_BREATHE REVIVES FILTHY WARM SWIMS

The ragged bloated corpse of a huge aquatic dinosaur the size of a house, with a crocodile-like head and swimming fins.

SEES HEARS DESTROYS WARM SWIMS AQUATIC POISON STUMBLES NO_BREATHE REVIVES FILTHY HIT_AND_RUN


Gorgon Group

[Gorgon Group](https://attack.mitre.org/groups/G0078) is a threat group consisting of members who are suspected to be Pakistan-based or have other connections to Pakistan. The group has performed a mix of criminal and targeted attacks, including campaigns against government organizations in the United Kingdom, Spain, Russia, and the United States. (Citation: Unit 42 Gorgon Group Aug 2018)

Falcone, R., et al. (2018, August 02). The Gorgon Group: Slithering Between Nation State and Cybercrime. Retrieved August 7, 2018.


#pragma once

// Including SDKDDKVer.h defines the highest available Windows platform.

// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.

#include <SDKDDKVer.h>


// Code generated by Wire protocol buffer compiler, do not edit.
// Source: samebasename.single_level.Bars in samebasename/single_level.proto
package com.squareup.wire.protos.single_level;

import com.squareup.wire.FieldEncoding;
import com.squareup.wire.Message;
import com.squareup.wire.ProtoAdapter;
import com.squareup.wire.ProtoReader;
import com.squareup.wire.ProtoWriter;
import com.squareup.wire.Syntax;
import com.squareup.wire.WireField;
import com.squareup.wire.internal.Internal;
import java.io.IOException;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.StringBuilder;
import java.util.List;
import okio.ByteString;

public final class Bars extends Message<Bars, Bars.Builder> {
  public static final ProtoAdapter<Bars> ADAPTER = new ProtoAdapter_Bars();

  private static final long serialVersionUID = 0L;

  @WireField(
      tag = 1,
      adapter = "com.squareup.wire.protos.single_level.Bar#ADAPTER",
      label = WireField.Label.REPEATED
  )
  public final List<Bar> bars;

  public Bars(List<Bar> bars) {
    this(bars, ByteString.EMPTY);
  }

  public Bars(List<Bar> bars, ByteString unknownFields) {
    super(ADAPTER, unknownFields);
    this.bars = Internal.immutableCopyOf("bars", bars);
  }

  @Override
  public Builder newBuilder() {
    Builder builder = new Builder();
    builder.bars = Internal.copyOf(bars);
    builder.addUnknownFields(unknownFields());
    return builder;
  }

  @Override
  public boolean equals(Object other) {
    if (other == this) return true;
    if (!(other instanceof Bars)) return false;
    Bars o = (Bars) other;
    return unknownFields().equals(o.unknownFields())
        && bars.equals(o.bars);
  }

  @Override
  public int hashCode() {
    int result = super.hashCode;
    if (result == 0) {
      result = unknownFields().hashCode();
      result = result * 37 + bars.hashCode();
      super.hashCode = result;
    }
    return result;
  }

  @Override
  public String toString() {
    StringBuilder builder = new StringBuilder();
    if (!bars.isEmpty()) builder.append(", bars=").append(bars);
    return builder.replace(0, 2, "Bars{").append('}').toString();
  }

  public static final class Builder extends Message.Builder<Bars, Builder> {
    public List<Bar> bars;

    public Builder() {
      bars = Internal.newMutableList();
    }

    public Builder bars(List<Bar> bars) {
      Internal.checkElementsNotNull(bars);
      this.bars = bars;
      return this;
    }

    @Override
    public Bars build() {
      return new Bars(bars, super.buildUnknownFields());
    }
  }

  private static final class ProtoAdapter_Bars extends ProtoAdapter<Bars> {
    public ProtoAdapter_Bars() {
      super(FieldEncoding.LENGTH_DELIMITED, Bars.class, "type.googleapis.com/samebasename.single_level.Bars", Syntax.PROTO_2, null);
    }

    @Override
    public int encodedSize(Bars value) {
      int result = 0;
      result += Bar.ADAPTER.asRepeated().encodedSizeWithTag(1, value.bars);
      result += value.unknownFields().size();
      return result;
    }

    @Override
    public void encode(ProtoWriter writer, Bars value) throws IOException {
      Bar.ADAPTER.asRepeated().encodeWithTag(writer, 1, value.bars);
      writer.writeBytes(value.unknownFields());
    }

    @Override
    public Bars decode(ProtoReader reader) throws IOException {
      Builder builder = new Builder();
      long token = reader.beginMessage();
      for (int tag; (tag = reader.nextTag()) != -1;) {
        switch (tag) {
          case 1: builder.bars.add(Bar.ADAPTER.decode(reader)); break;
          default: {
            reader.readUnknownField(tag);
          }
        }
      }
      builder.addUnknownFields(reader.endMessageAndGetUnknownFields(token));
      return builder.build();
    }

    @Override
    public Bars redact(Bars value) {
      Builder builder = value.newBuilder();
      Internal.redactElements(builder.bars, Bar.ADAPTER);
      builder.clearUnknownFields();
      return builder.build();
    }
  }
}


//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================

#ifndef VGUI_PROGRESSBAR_H
#define VGUI_PROGRESSBAR_H

#include<VGUI.h>
#include<VGUI_Panel.h>

namespace vgui
{

class VGUIAPI ProgressBar : public Panel
{
private:
	int   _segmentCount;
	float _progress;
public:
	ProgressBar(int segmentCount);
protected:
	virtual void paintBackground();
public:
	virtual void setProgress(float progress);
	virtual int  getSegmentCount();
};

}

#endif


package pipeline

import (
	"bufio"
	"fmt"
	"io"
	"regexp"
	"strings"
	"testing"
	"time"

	"context"
)

type RegexpFilter struct {
	rx *regexp.Regexp
}

func NewRegexpFilter(rx *regexp.Regexp) *RegexpFilter {
	return &RegexpFilter{
		rx: rx,
	}
}

func (rf *RegexpFilter) Accept(ctx context.Context, in chan interface{}, out ChanOutput) {
	defer fmt.Println("END RegexpFilter.Accept")
	defer out.SendEndMark("end of RegexpFilter")
	for {
		select {
		case <-ctx.Done():
			return
		case v := <-in:
			if err, ok := v.(error); ok {
				if IsEndMark(err) {
					return
				}
			}

			if s, ok := v.(string); ok {
				if rf.rx.MatchString(s) {
					out.Send(s)
				}
			}
		}
	}
}

type LineFeeder struct {
	lines []string
}

func NewLineFeeder(rdr io.Reader) *LineFeeder {
	scan := bufio.NewScanner(rdr)
	var lines []string
	for scan.Scan() {
		lines = append(lines, scan.Text())
	}
	return &LineFeeder{
		lines: lines,
	}
}

func (f *LineFeeder) Reset() {
}

func (f *LineFeeder) Start(ctx context.Context, out ChanOutput) {
	fmt.Println("START LineFeeder.Start")
	defer fmt.Println("END LineFeeder.Start")
	defer out.SendEndMark("end of LineFeeder")
	for _, s := range f.lines {
		out.Send(s)
	}
}

type Receiver struct {
	lines []string
	done  chan struct{}
}

func NewReceiver() *Receiver {
	r := &Receiver{}
	r.Reset()
	return r
}

func (r *Receiver) Reset() {
	r.done = make(chan struct{})
	r.lines = nil
}

func (r *Receiver) Done() <-chan struct{} {
	return r.done
}

func (r *Receiver) Accept(ctx context.Context, in chan interface{}, out ChanOutput) {
	defer fmt.Println("END Receiver.Accept")
	defer close(r.done)

	for {
		select {
		case <-ctx.Done():
			return
		case v := <-in:
			if err, ok := v.(error); ok {
				if IsEndMark(err) {
					return
				}
			}

			if s, ok := v.(string); ok {
				r.lines = append(r.lines, s)
			}
		}
	}
}

func TestPipeline(t *testing.T) {
	src := NewLineFeeder(strings.NewReader(`foo
bar
foobar
barfoo
`))
	n1 := NewRegexpFilter(regexp.MustCompile(`^foo`))
	n2 := NewRegexpFilter(regexp.MustCompile(`bar$`))
	dst := NewReceiver()

	p := New()
	p.SetSource(src)
	p.Add(n1)
	p.Add(n2)
	p.SetDestination(dst)

	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
	defer cancel()
	p.Run(ctx)
	t.Logf("%#v", dst.lines)
}


### 思路1

利用子查询先找出每个部门的最高工资，再联结两个表查询

```sql
SELECT MAX(e.Salary), e.DepartmentId
FROM Employee e
GROUP BY e.DepartmentId;
```

```sql
SELECT
d.Name AS Department,
e.Name AS Employee,
e.Salary
FROM Employee e JOIN Department d
ON e.DepartmentId=d.Id
WHERE (e.Salary, e.DepartmentId) IN (
    SELECT MAX(e.Salary), e.DepartmentId
    FROM Employee e
    GROUP BY e.DepartmentId
);
```


package cn.iocoder.mall.order.biz.enums.order;

/**
 * 订单取消原因
 * order_cancel_reasons
 * @author Sin
 * @time 2019-03-30 15:08
 */
public enum OrderCancelReasonsEnum {

    CANCEL_1(1, "无法联系上买家"),
    CANCEL_2(2, "买家误拍或重拍了"),
    CANCEL_3(3, "买家无诚意完成交易"),
    CANCEL_4(4, "已通过银行线下汇款"),
    CANCEL_5(5, "已通过同城见面交易"),
    CANCEL_6(6, "已通过货到付款交易"),
    CANCEL_7(7, "已通过网上银行直接汇款"),
    CANCEL_8(8, "已经缺货无法交易"),
    CANCEL_20(20, "其他"),
    ;

    // 无法联系上买家
    // 买家误拍或重拍了
    // 买家无诚意完成交易
    // 已通过银行线下汇款
    // 已通过同城见面交易
    // 已通过货到付款交易
    // 已通过网上银行直接汇款
    // 已经缺货无法交易

    private final int code;
    private final String message;

    OrderCancelReasonsEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public String toString() {
        return "OrderCancelEnum{" +
                "code=" + code +
                ", message='" + message + '\'' +
                '}';
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}


/* ============================================================
 *
 * This file is a part of digiKam project
 * https://www.digikam.org
 *
 * Date        : 2013-02-25
 * Description : Table view column helpers: Geographic columns
 *
 * Copyright (C) 2013 by Michael G. Hansen <mike at mghansen dot de>
 *
 * This program is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General
 * Public License as published by the Free Software Foundation;
 * either version 2, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * ============================================================ */

#include "tableview_column_geo.h"

// Qt includes

#include <QFormLayout>
#include <QComboBox>
#include <QLocale>

// KDE includes

#include <klocalizedstring.h>

// Local includes

#include "digikam_debug.h"
#include "iteminfo.h"

namespace
{

QString FormatAltitude(const qreal altitudeInMeters, const QLocale::MeasurementSystem& measureSystem)
{
    if (measureSystem == QLocale::MetricSystem)
    {
        const QString altitudeInMetersString = QLocale().toString(altitudeInMeters);
        return QString::fromUtf8("%1 m").arg(altitudeInMetersString);
    }
    else
    {
        const qreal altitudeInFeet         = altitudeInMeters /* m */ / ( 0.3048 /* m/foot */ );
        const QString altitudeInFeetString = QLocale().toString(altitudeInFeet, 'g', 2);
        return QString::fromUtf8("%1 ft").arg(altitudeInFeetString);
    }
}

} // namespace

namespace Digikam
{

namespace TableViewColumns
{

ColumnGeoProperties::ColumnGeoProperties(TableViewShared* const tableViewShared,
                                         const TableViewColumnConfiguration& pConfiguration,
                                         const SubColumn pSubColumn,
                                         QObject* const parent)
    : TableViewColumn(tableViewShared, pConfiguration, parent),
      subColumn(pSubColumn)
{
}

ColumnGeoProperties::~ColumnGeoProperties()
{
}

QStringList ColumnGeoProperties::getSubColumns()
{
    QStringList columns;
    columns << QLatin1String("geohascoordinates") << QLatin1String("geocoordinates")
            << QLatin1String("geoaltitude");

    return columns;
}

TableViewColumnDescription ColumnGeoProperties::getDescription()
{
    TableViewColumnDescription description(QLatin1String("geo-properties"), i18n("Geo properties"));
    description.setIcon(QLatin1String("globe"));
    description.addSubColumn(TableViewColumnDescription(QLatin1String("geohascoordinates"), i18n("Geotagged")));
    description.addSubColumn(TableViewColumnDescription(QLatin1String("geocoordinates"),    i18n("Coordinates")));
    description.addSubColumn(TableViewColumnDescription(QLatin1String("geoaltitude"),       i18n("Altitude")));

    return description;
}

QString ColumnGeoProperties::getTitle() const
{
    switch (subColumn)
    {
        case SubColumnHasCoordinates:
            return i18n("Geotagged");
        case SubColumnCoordinates:
            return i18n("Coordinates");
        case SubColumnAltitude:
            return i18n("Altitude");
    }

    return QString();
}

TableViewColumn::ColumnFlags ColumnGeoProperties::getColumnFlags() const
{
    ColumnFlags flags(ColumnNoFlags);

    if (subColumn == SubColumnAltitude)
    {
        flags |= ColumnCustomSorting | ColumnHasConfigurationWidget;
    }

    return flags;
}
QVariant ColumnGeoProperties::data(TableViewModel::Item* const item, const int role) const
{
    if ( (role != Qt::DisplayRole) &&
         (role != Qt::TextAlignmentRole) )
    {
        return QVariant();
    }

    if (role == Qt::TextAlignmentRole)
    {
        switch (subColumn)
        {
            case SubColumnAltitude:
                return QVariant(Qt::Alignment(Qt::AlignRight | Qt::AlignVCenter));

            default:
                return QVariant();
        }
    }

    const ItemInfo info = s->tableViewModel->infoFromItem(item);

    switch (subColumn)
    {
        case SubColumnHasCoordinates:
        {
            return info.hasCoordinates() ? i18n("Yes") : i18n("No");
        }

        case SubColumnCoordinates:
        {
            if (!info.hasCoordinates())
            {
                return QString();
            }

            return QString::fromUtf8("%1,%2").arg(QLocale().toString(info.latitudeNumber(),  'g', 7))
                                             .arg(QLocale().toString(info.longitudeNumber(), 'g', 7));
        }

        case SubColumnAltitude:
        {
            /// @todo Needs custom sorting
            if ((!info.hasCoordinates()) || (!info.hasAltitude()))
            {
                return QString();
            }

            /// @todo Use an enum instead to avoid lots of string comparisons
            const QString formatKey                  = configuration.getSetting(QLatin1String("format"), QLatin1String("metric"));
            QLocale::MeasurementSystem measureSystem = QLocale().measurementSystem();

            if (formatKey == QLatin1String("metric"))
            {
                measureSystem = QLocale::MetricSystem;
            }
            else if (formatKey == QLatin1String("imperial"))
            {
                measureSystem = QLocale::ImperialSystem;
            }

            const QString formattedAltitude = FormatAltitude(info.altitudeNumber(), measureSystem);

            return formattedAltitude;
        }
    }

    return QVariant();
}

TableViewColumn::ColumnCompareResult ColumnGeoProperties::compare(TableViewModel::Item* const itemA,
                                                                  TableViewModel::Item* const itemB) const
{
    const ItemInfo infoA = s->tableViewModel->infoFromItem(itemA);
    const ItemInfo infoB = s->tableViewModel->infoFromItem(itemB);

    if (subColumn == SubColumnAltitude)
    {
        const bool hasAltitudeA = infoA.hasAltitude();
        const bool hasAltitudeB = infoB.hasAltitude();

        if (hasAltitudeA && hasAltitudeB)
        {
            const double altitudeA = infoA.altitudeNumber();
            const double altitudeB = infoB.altitudeNumber();

            return (compareHelper<double>(altitudeA, altitudeB));
        }

        return (compareHelper<int>(int(hasAltitudeA), int(hasAltitudeB)));
    }

    qCWarning(DIGIKAM_GENERAL_LOG) << "geo: unimplemented comparison, subColumn=" << subColumn;

    return CmpEqual;
}

TableViewColumnConfigurationWidget* ColumnGeoProperties::getConfigurationWidget(QWidget* const parentWidget) const
{
    TableViewColumnConfiguration myConfiguration = getConfiguration();

    return (new ColumnGeoConfigurationWidget(s, myConfiguration, parentWidget));
}

// ----------------------------------------------------------------------------------------------------------------

ColumnGeoConfigurationWidget::ColumnGeoConfigurationWidget(TableViewShared* const sharedObject,
                                                           const TableViewColumnConfiguration& columnConfiguration,
                                                           QWidget* const parentWidget)
    : TableViewColumnConfigurationWidget(sharedObject, columnConfiguration, parentWidget),
      subColumn(ColumnGeoProperties::SubColumnHasCoordinates),
      selectorAltitudeUnit(nullptr)
{
    ColumnGeoProperties::getSubColumnIndex<ColumnGeoProperties>(configuration.columnId, &subColumn);

    switch (subColumn)
    {
        case ColumnGeoProperties::SubColumnAltitude:
        {
            QFormLayout* const box1 = new QFormLayout();
            selectorAltitudeUnit    = new QComboBox(this);
            selectorAltitudeUnit->addItem(i18n("Metric units"),   QLatin1String("metric"));
            selectorAltitudeUnit->addItem(i18n("Imperial units"), QLatin1String("imperial"));
            box1->addRow(i18n("Display format"), selectorAltitudeUnit);

            setLayout(box1);

            const int index = selectorAltitudeUnit->findData(configuration.getSetting(QLatin1String("format"), QLatin1String("metric")));
            selectorAltitudeUnit->setCurrentIndex(index >= 0 ? index : 0);
            break;
        }

        default:
            break;
    }
}

ColumnGeoConfigurationWidget::~ColumnGeoConfigurationWidget()
{
}

TableViewColumnConfiguration ColumnGeoConfigurationWidget::getNewConfiguration()
{
    const QString formatKey = selectorAltitudeUnit->itemData(selectorAltitudeUnit->currentIndex()).toString();
    configuration.columnSettings.insert(QLatin1String("format"), formatKey);

    return configuration;
}

void ColumnGeoProperties::setConfiguration(const TableViewColumnConfiguration& newConfiguration)
{
    configuration = newConfiguration;

    emit signalAllDataChanged();
}

} // namespace TableViewColumns

} // namespace Digikam


using ProtoBuf;
using VRage.ObjectBuilders;
using System.Xml.Serialization;

namespace VRage.Game
{
    [ProtoContract]
    [MyObjectBuilderDefinition]
    public class MyObjectBuilder_WeaponDefinition : MyObjectBuilder_DefinitionBase
    {
        [ProtoContract]
        public class WeaponAmmoData
        {
            [XmlAttribute]
            public int RateOfFire;

            [XmlAttribute]
            public string ShootSoundName;

            [XmlAttribute]
            public int ShotsInBurst;
        }

        [ProtoContract]
        public class WeaponAmmoMagazine
        {
            [XmlIgnore]
            public MyObjectBuilderType Type = typeof(MyObjectBuilder_AmmoMagazine);

            [XmlAttribute]
            [ProtoMember]
            public string Subtype;
        }

        [ProtoMember]
        public WeaponAmmoData ProjectileAmmoData = null;

        [ProtoMember]
        public WeaponAmmoData MissileAmmoData = null;

        [ProtoMember]
        public string NoAmmoSoundName = null;

        [ProtoMember]
        public string ReloadSoundName = null;

        [ProtoMember]
        public string SecondarySoundName = null;

        [ProtoMember]
        public string PhysicalMaterial = "Metal";

        [ProtoMember]
        public float DeviateShotAngle = 0;

        [ProtoMember]
        public float ReleaseTimeAfterFire = 0;

        [ProtoMember]
        public int MuzzleFlashLifeSpan = 0;

        [ProtoMember]
        public int ReloadTime = 2000;

        [XmlArrayItem("AmmoMagazine")]
        [ProtoMember]
        public WeaponAmmoMagazine[] AmmoMagazines;

        [XmlArrayItem("Effect")]
        [ProtoMember]
        public WeaponEffect[] Effects;

        [ProtoMember]
        public bool UseDefaultMuzzleFlash = true;

        [ProtoContract]
        public class WeaponEffect
        {
            [XmlAttribute, ProtoMember]
            public string Action = "";

            [XmlAttribute, ProtoMember]
            public string Dummy = "";

            [XmlAttribute, ProtoMember]
            public string Particle = "";

            [XmlAttribute, ProtoMember]
            public bool Loop = false;
        }
    }
}


Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices

' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.

' Review the values of the assembly attributes
<Assembly: AssemblyTitle("SilverlightApplication1")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("MSIT")>
<Assembly: AssemblyProduct("SilverlightApplication1")>
<Assembly: AssemblyCopyright("Copyright © MSIT 2009")>
<Assembly: AssemblyTrademark("")>

<Assembly: ComVisible(False)>

'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("ce88d5d7-4c39-43c4-95cc-04710d6b5adf")>

' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>