client/splunk.ui.charting.js
function(strList) {
            if (typeof(strList) != 'string' || !strList) return [];
            var items = [];
            var field_name_buffer = [];
            var inquote = false;
            var str = $.trim(strList);
            for (var i=0,j=str.length; i<j; i++) {
                if (str.charAt(i) == '\\') {
                    var nextidx = i+1;
                    if (j > nextidx && (str.charAt(nextidx) == '\\' || str.charAt(nextidx) == '"')) {
                        field_name_buffer.push(str.charAt(nextidx));
                        i++;
                        continue;
                    } else {
                        field_name_buffer.push(str.charAt(i));
                        continue;
                    }
                }

                if (str.charAt(i) == '"') {
                    if (!inquote) {
                        inquote = true;
                        continue;
                    } else {
                        inquote = false;
                        items.push(field_name_buffer.join(''));
                        field_name_buffer = [];
                        continue;
                    }
                }

                if ((str.charAt(i) == ' ' || str.charAt(i) == ',') && !inquote) {
                    if (field_name_buffer.length > 0) {
                        items.push(field_name_buffer.join(''));
                    }
                    field_name_buffer = [];
                    continue;
                }
                field_name_buffer.push(str.charAt(i));
            }
            if (field_name_buffer.length > 0) items.push(field_name_buffer.join(''));
            return items;
        }
function(strList) {
            if (typeof(strList) != 'string' || !strList) return [];
            var items = [];
            var field_name_buffer = [];
            var inquote = false;
            var str = $.trim(strList);
            for (var i=0,j=str.length; i<j; i++) {
                if (str.charAt(i) == '\\') {
                    var nextidx = i+1;
                    if (j > nextidx && (str.charAt(nextidx) == '\\' || str.charAt(nextidx) == '"')) {
                        field_name_buffer.push(str.charAt(nextidx));
                        i++;
                        continue;
                    } else {
                        field_name_buffer.push(str.charAt(i));
                        continue;
                    }
                }

                if (str.charAt(i) == '"') {
                    if (!inquote) {
                        inquote = true;
                        continue;
                    } else {
                        inquote = false;
                        items.push(field_name_buffer.join(''));
                        field_name_buffer = [];
                        continue;
                    }
                }

                if ((str.charAt(i) == ' ' || str.charAt(i) == ',') && !inquote) {
                    if (field_name_buffer.length > 0) {
                        items.push(field_name_buffer.join(''));
                    }
                    field_name_buffer = [];
                    continue;
                }
                field_name_buffer.push(str.charAt(i));
            }
            if (field_name_buffer.length > 0) items.push(field_name_buffer.join(''));
            return items;
        }
function ( strList ) { if ( typeof ( strList ) != 'string' || ! strList ) return [ ] ; var items = [ ] ; var field_name_buffer = [ ] ; var inquote = false ; var str = $ . trim ( strList ) ; for ( var i = 0 , j = str . length ; i < j ; i ++ ) { if ( str . charAt ( i ) == '\\' ) { var nextidx = i + 1 ; if ( j > nextidx && ( str . charAt ( nextidx ) == '\\' || str . charAt ( nextidx ) == '"' ) ) { field_name_buffer . push ( str . charAt ( nextidx ) ) ; i ++ ; continue ; } else { field_name_buffer . push ( str . charAt ( i ) ) ; continue ; } } if ( str . charAt ( i ) == '"' ) { if ( ! inquote ) { inquote = true ; continue ; } else { inquote = false ; items . push ( field_name_buffer . join ( '' ) ) ; field_name_buffer = [ ] ; continue ; } } if ( ( str . charAt ( i ) == ' ' || str . charAt ( i ) == ',' ) && ! inquote ) { if ( field_name_buffer . length > 0 ) { items . push ( field_name_buffer . join ( '' ) ) ; } field_name_buffer = [ ] ; continue ; } field_name_buffer . push ( str . charAt ( i ) ) ; } if ( field_name_buffer . length > 0 ) items . push ( field_name_buffer . join ( '' ) ) ; return items ; }
Deserializes a string into a field list.
Deserializes a string into a field list .