source/NetString.cpp
size_t NetString::FromV4Address( const uint8_t * const buffer, const size_t bufferLen, char * const output, const size_t outputLen ) {
	if ( outputLen < 16 || !output ) {
		// IP 4 Addresses are a minimum of 16 chars in length!
		return 0;
	} else if ( bufferLen < IP_V4_SEGMENTS || !buffer ) {
		// Needs an IP address to work!
		return 0;
	}

#if defined( __WIN_API__ )
	#pragma warning( push)
	#pragma warning( disable: 4996 )
#endif
	sprintf( output, "%u.%u.%u.%u", buffer[0], buffer[1], buffer[2], buffer[3] );
#if defined( __WIN_API__ )
	#pragma warning( pop )
#endif

	return strlen( output );
}
/*
====================
NetString::FromV4Address

	Converts a 4 byte IPv4 address to a character string
	The string is stored in the output buffer
====================
*/
:FromV4Address
Converts a 4 byte IPv4 address to a character string
The string is stored in the output buffer
: FromV4Address Converts a 4 byte IPv4 address to a character string The string is stored in the output buffer
size_t NetString::FromV4Address( const uint8_t * const buffer, const size_t bufferLen, char * const output, const size_t outputLen ) {
	if ( outputLen < 16 || !output ) {
		return 0;
	} else if ( bufferLen < IP_V4_SEGMENTS || !buffer ) {
		return 0;
	}
#if defined( __WIN_API__ )
	#pragma warning( push)
	#pragma warning( disable: 4996 )
#endif
	sprintf( output, "%u.%u.%u.%u", buffer[0], buffer[1], buffer[2], buffer[3] );
#if defined( __WIN_API__ )
	#pragma warning( pop )
#endif
	return strlen( output );
}
size_t NetString :: FromV4Address ( const uint8_t * const buffer , const size_t bufferLen , char * const output , const size_t outputLen ) { if ( outputLen < 16 || ! output ) { return 0 ; } else if ( bufferLen < IP_V4_SEGMENTS || ! buffer ) { return 0 ; } #if defined ( __WIN_API__ ) #pragma  warning( push) #pragma  warning( disable: 4996 ) #endif sprintf ( output , " " , buffer [ 0 ] , buffer [ 1 ] , buffer [ 2 ] , buffer [ 3 ] ) ; #if defined ( __WIN_API__ ) #pragma  warning( pop ) #endif return strlen ( output ) ; }
NetString::FromV4Address
Converts a 4 byte IPv4 address to a character string
The string is stored in the output buffer
NetString :: FromV4Address Converts a 4 byte IPv4 address to a character string The string is stored in the output buffer
// IP 4 Addresses are a minimum of 16 chars in length! // Needs an IP address to work!