Blender V5.0
GHOST_PathUtils.cc File Reference
#include <cassert>
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "GHOST_Debug.hh"
#include "GHOST_PathUtils.hh"
#include "GHOST_Types.h"

Go to the source code of this file.

Enumerations

enum  DecodeState_e { STATE_SEARCH = 0 , STATE_CONVERTING }

Functions

void GHOST_URL_decode (char *buf_dst, int buf_dst_size, const char *buf_src, const int buf_src_len)
char * GHOST_URL_decode_alloc (const char *buf_src, const int buf_src_len)

Enumeration Type Documentation

◆ DecodeState_e

Enumerator
STATE_SEARCH 

Searching for an ampersand to convert.

STATE_CONVERTING 

Convert the two proceeding characters from hex.

Definition at line 21 of file GHOST_PathUtils.cc.

Function Documentation

◆ GHOST_URL_decode()

void GHOST_URL_decode ( char * buf_dst,
int buf_dst_size,
const char * buf_src,
int buf_src_len )

Decode URL (i.e. converts file:///a%20b/test to file:///a b/test)

Parameters
buf_dstBuffer for decoded URL.
buf_dst_maxlenSize of output buffer.
buf_srcInput encoded buffer to be decoded.
buf_src_lenThe length of buf_src to use.

Definition at line 28 of file GHOST_PathUtils.cc.

References assert, GHOST_ASSERT, i, state, STATE_CONVERTING, and STATE_SEARCH.

Referenced by GHOST_URL_decode_alloc().

◆ GHOST_URL_decode_alloc()

char * GHOST_URL_decode_alloc ( const char * buf_src,
int buf_src_len )

A version of GHOST_URL_decode that allocates the string & returns it.

Parameters
buf_srcInput encoded buffer to be decoded.
Returns
The decoded output buffer.

Definition at line 90 of file GHOST_PathUtils.cc.

References free(), and GHOST_URL_decode().

Referenced by data_device_handle_drop(), GHOST_SystemWayland::getClipboardImage(), and GHOST_SystemWayland::hasClipboardImage().