Ejemplo n.º 1
0
// ////////////////////////////////////////////////////////////////////////////
std::string ExcEntry::ToString(const InsItem *item_list) const
{
	std::ostringstream o_str;

	o_str
		<< std::setw(5) << sequence_number_ << " "
		<< ((item_list[item_index_].IsInSequence())    ? "S" : " ")
		<< ((item_list[item_index_].IsInGroup())       ? "G" : " ")
		<< " "
		<< std::setw(5) << item_list[item_index_].auxiliary_id_ <<
			std::left << " "
		<< std::setw(31) << std::left << item_list[item_index_].field_name_ <<
			" " << std::setw(10) <<
			DataTypeToString(item_list[item_index_].data_type_) <<
			std::right << " = [";

	if (item_list[item_index_].IsTypePrimitive()) {
		if (is_null_)
			o_str << "] <*NULL*>";
		else {
			if (item_list[item_index_].IsTypeCharArray())
				o_str << datum_ptr_ << "]";
			else
				o_str << DatumToString(item_list[item_index_].data_type_,
					datum_length_, datum_ptr_) << "]";
		}
	}
	else
		o_str << "] <*N/A*>";

	return(o_str.str());
}
Ejemplo n.º 2
0
// ////////////////////////////////////////////////////////////////////////////
void ExcEntry::EmitFix(std::size_t datum_count, const ExcEntry *datum_list,
	const InsItem *item_list, bool null_flag, bool fid_flag, char pad_char,
	std::ostream &o_str)
{
	std::vector<std::string> tmp_list;

	tmp_list.reserve(datum_count);

	for (; datum_count; --datum_count, ++datum_list) {
		const InsItem *item_ptr = item_list + datum_list->item_index_;
		if (item_ptr->IsTypePrimitive() && (!item_ptr->IsLength()) &&
			(!item_ptr->IsDecimalChild())) {
			if ((!datum_list->is_null_) || null_flag) {
				std::ostringstream tmp_o_str;
				if (fid_flag)
					tmp_o_str << item_ptr->auxiliary_id_ << "=";
				else
					tmp_o_str << item_ptr->field_name_ << "=";
				tmp_o_str << ((datum_list->is_null_) ? "" :
					DatumToString(item_ptr->data_type_, datum_list->datum_length_,
						datum_list->datum_ptr_));
				tmp_list.push_back(tmp_o_str.str());
			}
		}
	}

	o_str << MLB::Utility::JoinString(tmp_list, std::string(1, pad_char));
}
Ejemplo n.º 3
0
// ////////////////////////////////////////////////////////////////////////////
std::string ExcEntry::ToStringDebug(const InsItem *item_list) const
{
	std::ostringstream o_str;

	o_str
		<< std::setw(5) << sequence_number_ << " "
		<< ((item_list[item_index_].IsInSequence())    ? "S" : " ")
		<< ((item_list[item_index_].IsInGroup())       ? "G" : " ")
		<< " "
		<< std::setw(5) << item_list[item_index_].auxiliary_id_ <<
			std::left << " "
		<< std::setw(31) << std::left << item_list[item_index_].field_name_ <<
			" " << std::setw(10) <<
			DataTypeToString(item_list[item_index_].data_type_) << " "
		<< std::setw(13) <<
			InsItemFlagBitsToString(item_list[item_index_].flags_) << " "
		<< std::setw(10) << item_list[item_index_].field_operator_
#ifdef VFAST_DEBUG_EXC_ENTRY
		<< " "
		<< "[PMap=" << pmap_flag_ << "] "
		<< "[Data=" << ToHexStringDebug(begin_ptr_, end_ptr_) << "]"
#else
		<< " "
		<< "[PMap=?] "
		<< "[Data=?? ?? ?? ?? ?? ?? ?? ?? ?? ??]"
#endif // #ifdef VFAST_DEBUG_EXC_ENTRY
		<< std::right << " = [";

	if (item_list[item_index_].IsTypePrimitive()) {
		if (is_null_)
			o_str << "] <*NULL*>";
		else {
			if (item_list[item_index_].IsTypeCharArray())
				o_str << datum_ptr_ << "]";
			else
				o_str << DatumToString(item_list[item_index_].data_type_,
					datum_length_, datum_ptr_) << "]";
		}
	}
	else
		o_str << "] <*N/A*>";

	return(o_str.str());
}
Ejemplo n.º 4
0
void ProjectionDlg::UpdateDatumStatus()
{
	bool bIsCommon = false;
	for (uint i = 0; i < g_EPSGDatums.size(); i++)
	{
		if (g_EPSGDatums[i].iCode == m_iDatum)
			bIsCommon = g_EPSGDatums[i].bCommon;
	}
	// If we've got a rare datum, but the UI is set to show the short list,
	//  change it to show the full list instead.
	if (!bIsCommon && !m_bShowAllDatums)
	{
		m_bShowAllDatums = true;
		RefreshDatums();
		TransferDataToWindow();
	}
	wxString str(DatumToString(m_iDatum), wxConvUTF8);
	m_pDatumCtrl->SetStringSelection(str);

	UpdateEllipsoid();
}
Ejemplo n.º 5
0
// ////////////////////////////////////////////////////////////////////////////
void ExcEntry::EmitXmlInternal(std::size_t datum_count,
	const ExcEntry *datum_list, const InsItem *item_list, bool null_flag,
	bool fid_flag, unsigned int pad_count, std::ostream &o_str,
	unsigned int indent_count)
{
	std::size_t count_1;

	for (count_1 = 0; count_1 < datum_count; ++count_1, ++datum_list) {
		const InsItem *item_ptr = item_list + datum_list->item_index_;
		if (item_ptr->data_type_ == DataType_Sequence) {
			const InsItem *seq_item_ptr   = item_ptr;
			unsigned int   sequence_count =
				*datum_list[1].GetDatumPtr<Type_UInt32>();
			count_1    += 2;
			datum_list += 2;
			if (sequence_count) {
				o_str
					<< std::setw(static_cast<std::streamsize>(
						indent_count * pad_count)) << "" << "<"
					<< seq_item_ptr->field_name_ << ">" << std::endl;
				unsigned int count_2;
				for (count_2 = 0; count_2 < sequence_count;
					++count_2, datum_list += (seq_item_ptr->element_count_ - 2)) {
					o_str
						<< std::setw(static_cast<std::streamsize>(
							(indent_count + 1) * pad_count)) << "" << "<"
						<< seq_item_ptr->field_name_ << ">" << std::endl;
					EmitXmlInternal(seq_item_ptr->element_count_ - 2,
						datum_list, item_list, null_flag, fid_flag, pad_count,
						o_str, indent_count + 2);
					o_str
						<< std::setw(static_cast<std::streamsize>(
							(indent_count + 1) * pad_count)) << "" << "</"
						<< seq_item_ptr->field_name_ << ">" << std::endl;
				}
				o_str
					<< std::setw(static_cast<std::streamsize>(
						indent_count * pad_count)) << "" << "</"
					<< seq_item_ptr->field_name_ << ">" << std::endl;
				count_1 += 2 + ((seq_item_ptr->element_count_ - 2) * sequence_count);
			}
		}
		else if (item_ptr->data_type_ == DataType_Group) {
			;
		}
		else if (item_ptr->data_type_ == DataType_TemplateRefStatic) {
			;
		}
		else if (item_ptr->data_type_ == DataType_TemplateRefDynamic) {
			;
		}
		else {
			o_str
				<< std::setw(static_cast<std::streamsize>(
					indent_count * pad_count)) << "" << "<"
				<< item_ptr->field_name_ << ">";
			if (!datum_list->is_null_)
				o_str << DatumToString(item_ptr->data_type_,
					datum_list->datum_length_, datum_list->datum_ptr_);
			o_str
				<< "</" << item_ptr->field_name_ << ">" << std::endl;
			if (item_ptr->data_type_ == DataType_Decimal) {
				count_1    += 2;
				datum_list += 2;
			}
		}
	}
}