Annotation of parser3/src/types/pa_varray.C, revision 1.1

1.1     ! moko        1: /** @file
        !             2:        Parser: @b array class.
        !             3: 
        !             4:        Copyright (c) 2001-2023 Art. Lebedev Studio (http://www.artlebedev.com)
        !             5:        Authors: Konstantin Morshnev <moko@design.ru>, Alexandr Petrosian <paf@design.ru>
        !             6: */
        !             7: 
        !             8: #include "pa_varray.h"
        !             9: #include "pa_vfile.h"
        !            10: 
        !            11: volatile const char * IDENT_PA_VARRAY_C="$Id: pa_varray.C,v 1.15 2023/09/26 20:49:12 moko Exp $" IDENT_PA_VARRAY_H;
        !            12: 
        !            13: HashStringValue& VArray::hash(){
        !            14:        if(fhash==0){
        !            15:                fhash=new HashStringValue();
        !            16:                for(ArrayValue::Iterator i(farray); i; i.next()) {
        !            17:                        Value *v=i.value();
        !            18:                        if(v)
        !            19:                                fhash->put(i.key(), v);
        !            20:                }
        !            21:        }
        !            22:        return *fhash;
        !            23: }
        !            24: 
        !            25: size_t VArray::count() const{
        !            26:        if(!fcount){
        !            27:                for(ArrayValue::Iterator i(farray); i;) {
        !            28:                        if(i.next())
        !            29:                                fcount++;
        !            30:                }
        !            31:        }
        !            32:        return fcount;
        !            33: }
        !            34: 
        !            35: const String* VArray::get_json_string(Json_options& options) {
        !            36:        return  options.array == Json_options::A_COMPACT ? options.array_compact_json_string(&array()) :
        !            37:                options.array == Json_options::A_ARRAY   ? options.array_json_string(&array()) : Value::get_json_string(options);
        !            38: }

E-mail: