• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

polserver / polserver / 28964407401

08 Jul 2026 05:58PM UTC coverage: 61.276% (+0.3%) from 60.927%
28964407401

push

github

web-flow
Split bobject header  (#892)

* splitted bobject header

* fixed runecl

* crashfix

* missing header

* more missing (debug build)

* runecl debug include

* renamed contiter, moved formating

* removed more unused headers

1145 of 1517 new or added lines in 23 files covered. (75.48%)

217 existing lines in 4 files now uncovered.

44972 of 73392 relevant lines covered (61.28%)

557151.3 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

62.23
/pol-core/bscript/bobjectimp.cpp
1
#include "bobjectimp.h"
2

3
#include "../clib/stlutil.h"
4
#include "barray.h"
5
#include "bboolean.h"
6
#include "bdict.h"
7
#include "bdouble.h"
8
#include "berror.h"
9
#include "blong.h"
10
#include "bstring.h"
11
#include "bstruct.h"
12
#include "buninit.h"
13
#include "objmembers.h"
14
#include "objmethods.h"
15

16
#if BOBJECTIMP_DEBUG
17
#include "../clib/logfacility.h"
18
#include "escriptv.h"
19
#include <unordered_map>
20
#endif
21

22

23
namespace Pol::Bscript
24
{
25

26

27
/**
28
 * Pack formats:
29
 * - sSTRING\0   string
30
 * - iINTEGER\0  integer
31
 * - rREAL\0     real
32
 * - u\0         uninitialized
33
 * - aNN:ELEMS   array
34
 * - SNN:STRING
35
 *
36
 * Examples:
37
 * - 57              i57
38
 * - 4.3             r4.3
39
 * - "hello world"   shello world
40
 * - { 5,3 }         a2:i5i3
41
 * - { 5, "hey" }    a2:i5S3:hey
42
 * - { 5, "hey", 7 } a3:i5S3:heyi7
43
 */
44
BObjectImp* BObjectImp::unpack( std::istream& is )
667✔
45
{
46
  char typech;
47
  if ( is >> typech )
667✔
48
  {
49
    switch ( typech )
667✔
50
    {
51
    case 's':
25✔
52
      return String::unpack( is );
25✔
53
    case 'S':
34✔
54
      return String::unpackWithLen( is );
34✔
55
    case 'i':
358✔
56
      return BLong::unpack( is );
358✔
57
    case 'r':
18✔
58
      return Double::unpack( is );
18✔
59
    case 'u':
189✔
60
      return UninitObject::create();
189✔
61
    case 'a':
19✔
62
      return ObjArray::unpack( is );
19✔
63
    case 'd':
9✔
64
      return BDictionary::unpack( is );
9✔
NEW
65
    case 't':
×
NEW
66
      return BStruct::unpack( is );
×
67
    case 'e':
3✔
68
      return BError::unpack( is );
3✔
NEW
69
    case 'x':
×
NEW
70
      return UninitObject::create();
×
71
    case 'b':
12✔
72
      return BBoolean::unpack( is );
12✔
73

NEW
74
    default:
×
NEW
75
      return new BError( "Unknown object type '" + std::string( 1, typech ) + "'" );
×
76
    }
77
  }
78
  else
79
  {
NEW
80
    return new BError( "Unable to extract type character" );
×
81
  }
82
}
83

84
BObjectImp* BObjectImp::unpack( const char* pstr )
179✔
85
{
86
  ISTRINGSTREAM is( pstr );
179✔
87
  return unpack( is );
358✔
88
}
179✔
89

90
#if BOBJECTIMP_DEBUG
91
typedef std::unordered_map<unsigned int, BObjectImp*> bobjectimps;
92

93

94
bobjectimps bobjectimp_instances;
95
int display_bobjectimp_instance( BObjectImp* imp )
96
{
97
  INFO_PRINTLN( "{}: {}", imp->instance(), imp->getStringRep() );
98
  return 0;
99
}
100
void display_bobjectimp_instances()
101
{
102
  INFO_PRINTLN( "bobjectimp instances: {}", bobjectimp_instances.size() );
103
  for ( bobjectimps::iterator itr = bobjectimp_instances.begin(); itr != bobjectimp_instances.end();
104
        ++itr )
105
  {
106
    display_bobjectimp_instance( ( *itr ).second );
107
  }
108
}
109
#endif
110

111
#if !INLINE_BOBJECTIMP_CTOR
112
unsigned int BObjectImp::instances_ = 0;
113
Clib::SpinLock BObjectImp::bobjectimp_lock;
114
BObjectImp::BObjectImp( BObjectType type ) : type_( type ), instance_( 0 )
115
{
116
  Clib::SpinLockGuard lock( bobjectimp_lock );
117
  instance_ = instances_++;
118
  ++eobject_imp_count;
119
  ++eobject_imp_constructions;
120
  bobjectimp_instances[instance_] = this;
121
}
122

123
BObjectImp::~BObjectImp()
124
{
125
  Clib::SpinLockGuard lock( bobjectimp_lock );
126
  bobjectimp_instances.erase( instance_ );
127
  --eobject_imp_count;
128
}
129
#endif
130

131
std::string BObjectImp::pack() const
178✔
132
{
133
  std::string str;
178✔
134
  packonto( str );
178✔
135
  return str;
178✔
NEW
136
}
×
137

138
void BObjectImp::packonto( std::string& str ) const
6✔
139
{
140
  str += "u";
6✔
141
}
6✔
142

143
std::string BObjectImp::getFormattedStringRep() const
1,087✔
144
{
145
  return getStringRep();
1,087✔
146
}
147

148
const char* BObjectImp::typestr( BObjectType typ )
337✔
149
{
150
  switch ( typ )
337✔
151
  {
NEW
152
  case OTUnknown:
×
NEW
153
    return "Unknown";
×
NEW
154
  case OTUninit:
×
NEW
155
    return "Uninit";
×
156
  case OTString:
203✔
157
    return "String";
203✔
158
  case OTLong:
61✔
159
    return "Integer";
61✔
160
  case OTDouble:
30✔
161
    return "Double";
30✔
162
  case OTArray:
18✔
163
    return "Array";
18✔
NEW
164
  case OTApplicObj:
×
NEW
165
    return "ApplicObj";
×
166
  case OTError:
2✔
167
    return "Error";
2✔
168
  case OTDictionary:
1✔
169
    return "Dictionary";
1✔
170
  case OTStruct:
1✔
171
    return "Struct";
1✔
NEW
172
  case OTPacket:
×
NEW
173
    return "Packet";
×
NEW
174
  case OTBinaryFile:
×
NEW
175
    return "BinaryFile";
×
176
  case OTBoolean:
6✔
177
    return "Boolean";
6✔
178
  case OTFuncRef:
15✔
179
    return "FunctionReference";
15✔
NEW
180
  default:
×
NEW
181
    return "Undefined";
×
182
  }
183
}
184

185
const char* BObjectImp::typeOf() const
202✔
186
{
187
  return typestr( type_ );
202✔
188
}
189

190

191
u8 BObjectImp::typeOfInt() const
68✔
192
{
193
  return type_;
68✔
194
}
195

196
/**
197
 * Can be overridden. By default objects are considered equal
198
 * only when having the same address in memory
199
 */
200
bool BObjectImp::operator==( const BObjectImp& objimp ) const
191✔
201
{
202
  return ( this == &objimp );
191✔
203
}
204
/**
205
 * Should be overridden. By default objects are lesser or greater
206
 * based on their type ID. Uninit and Error are always lesser than any other.
207
 * Same type object should have a custom comparison.
208
 *
209
 * @warning: do not forget to call base class when overriding
210
 */
211
bool BObjectImp::operator<( const BObjectImp& objimp ) const
272✔
212
{
213
  // Error an uninit are always lesser than any other type
214
  if ( ( objimp.type_ == OTError || objimp.type_ == OTUninit ) && type_ != OTError &&
272✔
215
       type_ != OTUninit )
45✔
216
    return false;
45✔
217

218
  if ( type_ == objimp.type_ )
227✔
219
  {
220
    // This is "undefined behavior" and should be avoided by implementing
221
    // comparison in child class
NEW
222
    return ( this < &objimp );
×
223
  }
224

225
  return type_ < objimp.type_;
227✔
226
}
227
/**
228
 * Can be overridden. By default uses == and <
229
 */
230
bool BObjectImp::operator<=( const BObjectImp& objimp ) const
803✔
231
{
232
  return *this == objimp || *this < objimp;
803✔
233
}
234
/**
235
 * Can be overridden. By default uses == and <
236
 */
237
bool BObjectImp::operator>( const BObjectImp& objimp ) const
6,041✔
238
{
239
  return !( *this == objimp || *this < objimp );
6,041✔
240
}
241
/**
242
 * Can be overridden. By default uses <
243
 */
244
bool BObjectImp::operator>=( const BObjectImp& objimp ) const
6,681✔
245
{
246
  return !( *this < objimp );
6,681✔
247
}
248
/**
249
 * Can be overridden. By default uses ==
250
 */
251
bool BObjectImp::operator!=( const BObjectImp& objimp ) const
27,438✔
252
{
253
  return !( *this == objimp );
27,438✔
254
}
255

256
BObjectImp* BObjectImp::array_assign( BObjectImp* /*idx*/, BObjectImp* /*target*/, bool /*copy*/ )
3✔
257
{
258
  return this;
3✔
259
}
260

261
BObjectRef BObjectImp::OperMultiSubscript( std::stack<BObjectRef>& indices )
6✔
262
{
263
  BObjectRef index = indices.top();
6✔
264
  indices.pop();
6✔
265
  BObjectRef ref = OperSubscript( *index );
6✔
266
  if ( indices.empty() )
6✔
267
    return ref;
3✔
268
  return ( *ref ).impptr()->OperMultiSubscript( indices );
3✔
269
}
6✔
270

NEW
271
BObjectRef BObjectImp::OperMultiSubscriptAssign( std::stack<BObjectRef>& indices,
×
272
                                                 BObjectImp* target )
273
{
NEW
274
  BObjectRef index = indices.top();
×
NEW
275
  indices.pop();
×
NEW
276
  if ( indices.empty() )
×
277
  {
NEW
278
    BObjectImp* imp = array_assign( ( *index ).impptr(), target, false );
×
NEW
279
    return BObjectRef( imp );
×
280
  }
281

NEW
282
  BObjectRef ref = OperSubscript( *index );
×
NEW
283
  return ( *ref ).impptr()->OperMultiSubscript( indices );
×
NEW
284
}
×
285

286
BObjectImp* BObjectImp::selfIsObjImp( const BObjectImp& objimp ) const
6✔
287
{
288
  return objimp.selfIsObj( *this );
6✔
289
}
290

291
BObjectImp* BObjectImp::selfIsObj( const BObjectImp& ) const
6✔
292
{
293
  return new BLong( 0 );
6✔
294
}
295

296
BObjectImp* BObjectImp::selfPlusObjImp( const BObjectImp& objimp ) const
1,227✔
297
{
298
  return objimp.selfPlusObj( *this );
1,227✔
299
}
300
BObjectImp* BObjectImp::selfPlusObj( const BObjectImp& /*objimp*/ ) const
57✔
301
{
302
  return copy();
57✔
303
}
304
BObjectImp* BObjectImp::selfPlusObj( const BLong& /*objimp*/ ) const
9✔
305
{
306
  return copy();
9✔
307
}
308
BObjectImp* BObjectImp::selfPlusObj( const Double& /*objimp*/ ) const
9✔
309
{
310
  return copy();
9✔
311
}
312
BObjectImp* BObjectImp::selfPlusObj( const String& /*objimp*/ ) const
24✔
313
{
314
  return copy();
24✔
315
}
316
BObjectImp* BObjectImp::selfPlusObj( const ObjArray& /*objimp*/ ) const
15✔
317
{
318
  return copy();
15✔
319
}
320
void BObjectImp::selfPlusObjImp( BObjectImp& objimp, BObject& obj )
78✔
321
{
322
  objimp.selfPlusObj( *this, obj );
78✔
323
}
78✔
324
void BObjectImp::selfPlusObj( BObjectImp& /*objimp*/, BObject& /*obj*/ )
45✔
325
{
326
  //
327
}
45✔
328
void BObjectImp::selfPlusObj( BLong& /*objimp*/, BObject& /*obj*/ )
15✔
329
{
330
  //
331
}
15✔
332
void BObjectImp::selfPlusObj( Double& /*objimp*/, BObject& /*obj*/ )
9✔
333
{
334
  // obj.setimp( selfPlusObj(objimp) );
335
}
9✔
336
void BObjectImp::selfPlusObj( String& /*objimp*/, BObject& /*obj*/ )
9✔
337
{
338
  // obj.setimp( selfPlusObj(objimp) );
339
}
9✔
340
void BObjectImp::selfPlusObj( ObjArray& /*objimp*/, BObject& /*obj*/ )
15✔
341
{
342
  // obj.setimp( selfPlusObj(objimp) );
343
}
15✔
344

345
BObjectImp* BObjectImp::selfMinusObjImp( const BObjectImp& objimp ) const
105✔
346
{
347
  return objimp.selfMinusObj( *this );
105✔
348
}
349
BObjectImp* BObjectImp::selfMinusObj( const BObjectImp& /*objimp*/ ) const
72✔
350
{
351
  return copy();
72✔
352
}
353
BObjectImp* BObjectImp::selfMinusObj( const BLong& /*objimp*/ ) const
12✔
354
{
355
  return copy();
12✔
356
}
357
BObjectImp* BObjectImp::selfMinusObj( const Double& /*objimp*/ ) const
12✔
358
{
359
  return copy();
12✔
360
}
361
BObjectImp* BObjectImp::selfMinusObj( const String& /*objimp*/ ) const
33✔
362
{
363
  return copy();
33✔
364
}
NEW
365
BObjectImp* BObjectImp::selfMinusObj( const ObjArray& /*objimp*/ ) const
×
366
{
NEW
367
  return copy();
×
368
}
369
void BObjectImp::selfMinusObjImp( BObjectImp& objimp, BObject& obj )
105✔
370
{
371
  objimp.selfMinusObj( *this, obj );
105✔
372
}
105✔
373
void BObjectImp::selfMinusObj( BObjectImp& /*objimp*/, BObject& /*obj*/ )
72✔
374
{
375
  //
376
}
72✔
377
void BObjectImp::selfMinusObj( BLong& /*objimp*/, BObject& /*obj*/ )
12✔
378
{
379
  //
380
}
12✔
381
void BObjectImp::selfMinusObj( Double& /*objimp*/, BObject& /*obj*/ )
12✔
382
{
383
  //
384
}
12✔
385
void BObjectImp::selfMinusObj( String& /*objimp*/, BObject& /*obj*/ )
12✔
386
{
387
  //
388
}
12✔
NEW
389
void BObjectImp::selfMinusObj( ObjArray& /*objimp*/, BObject& /*obj*/ )
×
390
{
391
  //
NEW
392
}
×
393

394
BObjectImp* BObjectImp::selfTimesObjImp( const BObjectImp& objimp ) const
237✔
395
{
396
  return objimp.selfTimesObj( *this );
237✔
397
}
398
BObjectImp* BObjectImp::selfTimesObj( const BObjectImp& /*objimp*/ ) const
237✔
399
{
400
  return copy();
237✔
401
}
402
BObjectImp* BObjectImp::selfTimesObj( const BLong& /*objimp*/ ) const
24✔
403
{
404
  return copy();
24✔
405
}
406
BObjectImp* BObjectImp::selfTimesObj( const Double& /*objimp*/ ) const
24✔
407
{
408
  return copy();
24✔
409
}
NEW
410
BObjectImp* BObjectImp::selfTimesObj( const String& /*objimp*/ ) const
×
411
{
NEW
412
  return copy();
×
413
}
NEW
414
BObjectImp* BObjectImp::selfTimesObj( const ObjArray& /*objimp*/ ) const
×
415
{
NEW
416
  return copy();
×
417
}
418
void BObjectImp::selfTimesObjImp( BObjectImp& objimp, BObject& obj )
162✔
419
{
420
  objimp.selfTimesObj( *this, obj );
162✔
421
}
162✔
422
void BObjectImp::selfTimesObj( BObjectImp& /*objimp*/, BObject& /*obj*/ )
162✔
423
{
424
  //
425
}
162✔
426
void BObjectImp::selfTimesObj( BLong& /*objimp*/, BObject& /*obj*/ )
24✔
427
{
428
  //
429
}
24✔
430
void BObjectImp::selfTimesObj( Double& /*objimp*/, BObject& /*obj*/ )
24✔
431
{
432
  //
433
}
24✔
NEW
434
void BObjectImp::selfTimesObj( String& /*objimp*/, BObject& /*obj*/ )
×
435
{
436
  //
NEW
437
}
×
NEW
438
void BObjectImp::selfTimesObj( ObjArray& /*objimp*/, BObject& /*obj*/ )
×
439
{
440
  //
NEW
441
}
×
442

443
BObjectImp* BObjectImp::selfDividedByObjImp( const BObjectImp& objimp ) const
237✔
444
{
445
  return objimp.selfDividedByObj( *this );
237✔
446
}
447
BObjectImp* BObjectImp::selfDividedByObj( const BObjectImp& /*objimp*/ ) const
237✔
448
{
449
  return copy();
237✔
450
}
451
BObjectImp* BObjectImp::selfDividedByObj( const BLong& /*objimp*/ ) const
24✔
452
{
453
  return copy();
24✔
454
}
455
BObjectImp* BObjectImp::selfDividedByObj( const Double& /*objimp*/ ) const
24✔
456
{
457
  return copy();
24✔
458
}
NEW
459
BObjectImp* BObjectImp::selfDividedByObj( const String& /*objimp*/ ) const
×
460
{
NEW
461
  return copy();
×
462
}
NEW
463
BObjectImp* BObjectImp::selfDividedByObj( const ObjArray& /*objimp*/ ) const
×
464
{
NEW
465
  return copy();
×
466
}
467
void BObjectImp::selfDividedByObjImp( BObjectImp& objimp, BObject& obj )
162✔
468
{
469
  objimp.selfDividedByObj( *this, obj );
162✔
470
}
162✔
471
void BObjectImp::selfDividedByObj( BObjectImp& /*objimp*/, BObject& /*obj*/ )
162✔
472
{
473
  //
474
}
162✔
475
void BObjectImp::selfDividedByObj( BLong& /*objimp*/, BObject& /*obj*/ )
24✔
476
{
477
  //
478
}
24✔
479
void BObjectImp::selfDividedByObj( Double& /*objimp*/, BObject& /*obj*/ )
24✔
480
{
481
  //
482
}
24✔
NEW
483
void BObjectImp::selfDividedByObj( String& /*objimp*/, BObject& /*obj*/ )
×
484
{
485
  //
NEW
486
}
×
NEW
487
void BObjectImp::selfDividedByObj( ObjArray& /*objimp*/, BObject& /*obj*/ )
×
488
{
489
  //
NEW
490
}
×
491

492
BObjectImp* BObjectImp::selfModulusObjImp( const BObjectImp& objimp ) const
237✔
493
{
494
  return objimp.selfModulusObj( *this );
237✔
495
}
496
BObjectImp* BObjectImp::selfModulusObj( const BObjectImp& /*objimp*/ ) const
237✔
497
{
498
  return copy();
237✔
499
}
500
BObjectImp* BObjectImp::selfModulusObj( const BLong& /*objimp*/ ) const
24✔
501
{
502
  return copy();
24✔
503
}
504
BObjectImp* BObjectImp::selfModulusObj( const Double& /*objimp*/ ) const
24✔
505
{
506
  return copy();
24✔
507
}
NEW
508
BObjectImp* BObjectImp::selfModulusObj( const String& /*objimp*/ ) const
×
509
{
NEW
510
  return copy();
×
511
}
NEW
512
BObjectImp* BObjectImp::selfModulusObj( const ObjArray& /*objimp*/ ) const
×
513
{
NEW
514
  return copy();
×
515
}
516
void BObjectImp::selfModulusObjImp( BObjectImp& objimp, BObject& obj )
162✔
517
{
518
  objimp.selfModulusObj( *this, obj );
162✔
519
}
162✔
520
void BObjectImp::selfModulusObj( BObjectImp& /*objimp*/, BObject& /*obj*/ )
162✔
521
{
522
  //
523
}
162✔
524
void BObjectImp::selfModulusObj( BLong& /*objimp*/, BObject& /*obj*/ )
24✔
525
{
526
  //
527
}
24✔
528
void BObjectImp::selfModulusObj( Double& /*objimp*/, BObject& /*obj*/ )
24✔
529
{
530
  //
531
}
24✔
NEW
532
void BObjectImp::selfModulusObj( String& /*objimp*/, BObject& /*obj*/ )
×
533
{
534
  //
NEW
535
}
×
NEW
536
void BObjectImp::selfModulusObj( ObjArray& /*objimp*/, BObject& /*obj*/ )
×
537
{
538
  //
NEW
539
}
×
540

541
BObjectImp* BObjectImp::selfBitShiftRightObjImp( const BObjectImp& objimp ) const
267✔
542
{
543
  return objimp.selfBitShiftRightObj( *this );
267✔
544
}
545
BObjectImp* BObjectImp::selfBitShiftRightObj( const BObjectImp& /*objimp*/ ) const
267✔
546
{
547
  return copy();
267✔
548
}
549
BObjectImp* BObjectImp::selfBitShiftRightObj( const BLong& /*objimp*/ ) const
27✔
550
{
551
  return copy();
27✔
552
}
NEW
553
BObjectImp* BObjectImp::selfBitShiftRightObj( const Double& /*objimp*/ ) const
×
554
{
NEW
555
  return copy();
×
556
}
NEW
557
BObjectImp* BObjectImp::selfBitShiftRightObj( const String& /*objimp*/ ) const
×
558
{
NEW
559
  return copy();
×
560
}
NEW
561
BObjectImp* BObjectImp::selfBitShiftRightObj( const ObjArray& /*objimp*/ ) const
×
562
{
NEW
563
  return copy();
×
564
}
NEW
565
void BObjectImp::selfBitShiftRightObjImp( BObjectImp& objimp, BObject& obj )
×
566
{
NEW
567
  objimp.selfBitShiftRightObj( *this, obj );
×
NEW
568
}
×
NEW
569
void BObjectImp::selfBitShiftRightObj( BObjectImp& /*objimp*/, BObject& /*obj*/ )
×
570
{
571
  //
NEW
572
}
×
NEW
573
void BObjectImp::selfBitShiftRightObj( BLong& /*objimp*/, BObject& /*obj*/ )
×
574
{
575
  //
NEW
576
}
×
NEW
577
void BObjectImp::selfBitShiftRightObj( Double& /*objimp*/, BObject& /*obj*/ )
×
578
{
579
  //
NEW
580
}
×
NEW
581
void BObjectImp::selfBitShiftRightObj( String& /*objimp*/, BObject& /*obj*/ )
×
582
{
583
  //
NEW
584
}
×
NEW
585
void BObjectImp::selfBitShiftRightObj( ObjArray& /*objimp*/, BObject& /*obj*/ )
×
586
{
587
  //
NEW
588
}
×
589

590
BObjectImp* BObjectImp::selfBitShiftLeftObjImp( const BObjectImp& objimp ) const
267✔
591
{
592
  return objimp.selfBitShiftLeftObj( *this );
267✔
593
}
594
BObjectImp* BObjectImp::selfBitShiftLeftObj( const BObjectImp& /*objimp*/ ) const
267✔
595
{
596
  return copy();
267✔
597
}
598
BObjectImp* BObjectImp::selfBitShiftLeftObj( const BLong& /*objimp*/ ) const
27✔
599
{
600
  return copy();
27✔
601
}
NEW
602
BObjectImp* BObjectImp::selfBitShiftLeftObj( const Double& /*objimp*/ ) const
×
603
{
NEW
604
  return copy();
×
605
}
NEW
606
BObjectImp* BObjectImp::selfBitShiftLeftObj( const String& /*objimp*/ ) const
×
607
{
NEW
608
  return copy();
×
609
}
NEW
610
BObjectImp* BObjectImp::selfBitShiftLeftObj( const ObjArray& /*objimp*/ ) const
×
611
{
NEW
612
  return copy();
×
613
}
NEW
614
void BObjectImp::selfBitShiftLeftObjImp( BObjectImp& objimp, BObject& obj )
×
615
{
NEW
616
  objimp.selfBitShiftLeftObj( *this, obj );
×
NEW
617
}
×
NEW
618
void BObjectImp::selfBitShiftLeftObj( BObjectImp& /*objimp*/, BObject& /*obj*/ )
×
619
{
620
  //
NEW
621
}
×
NEW
622
void BObjectImp::selfBitShiftLeftObj( BLong& /*objimp*/, BObject& /*obj*/ )
×
623
{
624
  //
NEW
625
}
×
NEW
626
void BObjectImp::selfBitShiftLeftObj( Double& /*objimp*/, BObject& /*obj*/ )
×
627
{
628
  //
NEW
629
}
×
NEW
630
void BObjectImp::selfBitShiftLeftObj( String& /*objimp*/, BObject& /*obj*/ )
×
631
{
632
  //
NEW
633
}
×
NEW
634
void BObjectImp::selfBitShiftLeftObj( ObjArray& /*objimp*/, BObject& /*obj*/ )
×
635
{
636
  //
NEW
637
}
×
638

639
BObjectImp* BObjectImp::selfBitAndObjImp( const BObjectImp& objimp ) const
267✔
640
{
641
  return objimp.selfBitAndObj( *this );
267✔
642
}
643
BObjectImp* BObjectImp::selfBitAndObj( const BObjectImp& /*objimp*/ ) const
267✔
644
{
645
  return copy();
267✔
646
}
647
BObjectImp* BObjectImp::selfBitAndObj( const BLong& /*objimp*/ ) const
28✔
648
{
649
  return copy();
28✔
650
}
NEW
651
BObjectImp* BObjectImp::selfBitAndObj( const Double& /*objimp*/ ) const
×
652
{
NEW
653
  return copy();
×
654
}
NEW
655
BObjectImp* BObjectImp::selfBitAndObj( const String& /*objimp*/ ) const
×
656
{
NEW
657
  return copy();
×
658
}
NEW
659
BObjectImp* BObjectImp::selfBitAndObj( const ObjArray& /*objimp*/ ) const
×
660
{
NEW
661
  return copy();
×
662
}
NEW
663
void BObjectImp::selfBitAndObjImp( BObjectImp& objimp, BObject& obj )
×
664
{
NEW
665
  objimp.selfBitAndObj( *this, obj );
×
NEW
666
}
×
NEW
667
void BObjectImp::selfBitAndObj( BObjectImp& /*objimp*/, BObject& /*obj*/ )
×
668
{
669
  //
NEW
670
}
×
NEW
671
void BObjectImp::selfBitAndObj( BLong& /*objimp*/, BObject& /*obj*/ )
×
672
{
673
  //
NEW
674
}
×
NEW
675
void BObjectImp::selfBitAndObj( Double& /*objimp*/, BObject& /*obj*/ )
×
676
{
677
  //
NEW
678
}
×
NEW
679
void BObjectImp::selfBitAndObj( String& /*objimp*/, BObject& /*obj*/ )
×
680
{
681
  //
NEW
682
}
×
NEW
683
void BObjectImp::selfBitAndObj( ObjArray& /*objimp*/, BObject& /*obj*/ )
×
684
{
685
  //
NEW
686
}
×
687

688
BObjectImp* BObjectImp::selfBitOrObjImp( const BObjectImp& objimp ) const
267✔
689
{
690
  return objimp.selfBitOrObj( *this );
267✔
691
}
692
BObjectImp* BObjectImp::selfBitOrObj( const BObjectImp& /*objimp*/ ) const
267✔
693
{
694
  return copy();
267✔
695
}
696
BObjectImp* BObjectImp::selfBitOrObj( const BLong& /*objimp*/ ) const
27✔
697
{
698
  return copy();
27✔
699
}
NEW
700
BObjectImp* BObjectImp::selfBitOrObj( const Double& /*objimp*/ ) const
×
701
{
NEW
702
  return copy();
×
703
}
NEW
704
BObjectImp* BObjectImp::selfBitOrObj( const String& /*objimp*/ ) const
×
705
{
NEW
706
  return copy();
×
707
}
NEW
708
BObjectImp* BObjectImp::selfBitOrObj( const ObjArray& /*objimp*/ ) const
×
709
{
NEW
710
  return copy();
×
711
}
NEW
712
void BObjectImp::selfBitOrObjImp( BObjectImp& objimp, BObject& obj )
×
713
{
NEW
714
  objimp.selfBitOrObj( *this, obj );
×
NEW
715
}
×
NEW
716
void BObjectImp::selfBitOrObj( BObjectImp& /*objimp*/, BObject& /*obj*/ )
×
717
{
718
  //
NEW
719
}
×
NEW
720
void BObjectImp::selfBitOrObj( BLong& /*objimp*/, BObject& /*obj*/ )
×
721
{
722
  //
NEW
723
}
×
NEW
724
void BObjectImp::selfBitOrObj( Double& /*objimp*/, BObject& /*obj*/ )
×
725
{
726
  //
NEW
727
}
×
NEW
728
void BObjectImp::selfBitOrObj( String& /*objimp*/, BObject& /*obj*/ )
×
729
{
730
  //
NEW
731
}
×
NEW
732
void BObjectImp::selfBitOrObj( ObjArray& /*objimp*/, BObject& /*obj*/ )
×
733
{
734
  //
NEW
735
}
×
736

737
BObjectImp* BObjectImp::selfBitXorObjImp( const BObjectImp& objimp ) const
267✔
738
{
739
  return objimp.selfBitXorObj( *this );
267✔
740
}
741
BObjectImp* BObjectImp::selfBitXorObj( const BObjectImp& /*objimp*/ ) const
267✔
742
{
743
  return copy();
267✔
744
}
745
BObjectImp* BObjectImp::selfBitXorObj( const BLong& /*objimp*/ ) const
27✔
746
{
747
  return copy();
27✔
748
}
NEW
749
BObjectImp* BObjectImp::selfBitXorObj( const Double& /*objimp*/ ) const
×
750
{
NEW
751
  return copy();
×
752
}
NEW
753
BObjectImp* BObjectImp::selfBitXorObj( const String& /*objimp*/ ) const
×
754
{
NEW
755
  return copy();
×
756
}
NEW
757
BObjectImp* BObjectImp::selfBitXorObj( const ObjArray& /*objimp*/ ) const
×
758
{
NEW
759
  return copy();
×
760
}
NEW
761
void BObjectImp::selfBitXorObjImp( BObjectImp& objimp, BObject& obj )
×
762
{
NEW
763
  objimp.selfBitXorObj( *this, obj );
×
NEW
764
}
×
NEW
765
void BObjectImp::selfBitXorObj( BObjectImp& /*objimp*/, BObject& /*obj*/ )
×
766
{
767
  //
NEW
768
}
×
NEW
769
void BObjectImp::selfBitXorObj( BLong& /*objimp*/, BObject& /*obj*/ )
×
770
{
771
  //
NEW
772
}
×
NEW
773
void BObjectImp::selfBitXorObj( Double& /*objimp*/, BObject& /*obj*/ )
×
774
{
775
  //
NEW
776
}
×
NEW
777
void BObjectImp::selfBitXorObj( String& /*objimp*/, BObject& /*obj*/ )
×
778
{
779
  //
NEW
780
}
×
NEW
781
void BObjectImp::selfBitXorObj( ObjArray& /*objimp*/, BObject& /*obj*/ )
×
782
{
783
  //
NEW
784
}
×
785

786
BObjectImp* BObjectImp::bitnot() const
132✔
787
{
788
  return copy();
132✔
789
}
790

NEW
791
void BObjectImp::operInsertInto( BObject& obj, const BObjectImp& /*objimp*/ )
×
792
{
NEW
793
  obj.setimp( new BError( "Object is not a 'container'" ) );
×
NEW
794
}
×
795

796

797
void BObjectImp::operPlusEqual( BObject& obj, BObjectImp& objimp )
983✔
798
{
799
  objimp.selfPlusObjImp( *this, obj );
983✔
800
  // obj.setimp( objimp.selfPlusObjImp( *this ) );
801
}
983✔
802

803
void BObjectImp::operMinusEqual( BObject& obj, BObjectImp& objimp )
246✔
804
{
805
  objimp.selfMinusObjImp( *this, obj );
246✔
806
  // obj.setimp( selfMinusObjImp( objimp ) );
807
}
246✔
808

809
void BObjectImp::operTimesEqual( BObject& obj, BObjectImp& objimp )
246✔
810
{
811
  objimp.selfTimesObjImp( *this, obj );
246✔
812
  // obj.setimp( selfTimesObjImp( objimp ) );
813
}
246✔
814

815
void BObjectImp::operDivideEqual( BObject& obj, BObjectImp& objimp )
234✔
816
{
817
  objimp.selfDividedByObjImp( *this, obj );
234✔
818
  // obj.setimp( selfDividedByObjImp( objimp ) );
819
}
234✔
820

821
void BObjectImp::operModulusEqual( BObject& obj, BObjectImp& objimp )
381✔
822
{
823
  objimp.selfModulusObjImp( *this, obj );
381✔
824
  // obj.setimp( selfModulusObjImp( objimp ) );
825
}
381✔
826

NEW
827
BObject BObjectImp::operator-() const
×
828
{
NEW
829
  BObjectImp* newobj = inverse();
×
NEW
830
  return BObject( newobj );
×
831
}
832

833
BObjectImp* BObjectImp::inverse() const
105✔
834
{
835
  return UninitObject::create();
105✔
836
}
837

838
void BObjectImp::selfPlusPlus() {}
18✔
839

840
void BObjectImp::selfMinusMinus() {}
9✔
841

842
BObjectRef BObjectImp::OperSubscript( const BObject& /*obj*/ )
25✔
843
{
844
  return BObjectRef( copy() );
25✔
845
}
846

847
/*
848
  "All Objects are inherently good."
849
  */
850
bool BObjectImp::isTrue() const
2,398✔
851
{
852
  return true;
2,398✔
853
}
854

855
BObjectImp* BObjectImp::call_method( const char* methodname, Executor& /*ex*/ )
25✔
856
{
857
  return new BError( std::string( "Method '" ) + methodname + "' not found" );
25✔
858
}
859
BObjectImp* BObjectImp::call_method_id( const int id, Executor& /*ex*/, bool /*forcebuiltin*/ )
3✔
860
{
861
  return new BError( fmt::format( "Method id '{}' ({}) not found", id, getObjMethod( id )->code ) );
6✔
862
}
863
BObjectRef BObjectImp::set_member( const char* membername, BObjectImp* /*valueimp*/, bool /*copy*/ )
3✔
864
{
865
  return BObjectRef( new BError( std::string( "Member '" ) + membername + "' not found" ) );
6✔
866
}
867
BObjectRef BObjectImp::get_member( const char* /*membername*/ )
37✔
868
{
869
  return BObjectRef( new BError( "Object does not support members" ) );
74✔
870
}
871
BObjectRef BObjectImp::get_member_id( const int id )
7,754✔
872
{
873
  ObjMember* memb = getObjMember( id );
7,754✔
874

875
  return get_member( memb->code );
7,754✔
876
}
877
BObjectRef BObjectImp::set_member_id( const int id, BObjectImp* valueimp, bool copy )
190✔
878
{
879
  ObjMember* memb = getObjMember( id );
190✔
880

881
  return set_member( memb->code, valueimp, copy );
190✔
882
}
883
long BObjectImp::contains( const BObjectImp& /*imp*/ ) const
3✔
884
{
885
  return 0;
3✔
886
}
887

888
BObjectRef BObjectImp::operDotPlus( const char* /*name*/ )
78✔
889
{
890
  return BObjectRef( new BError( "Operator .+ undefined" ) );
156✔
891
}
892

893
BObjectRef BObjectImp::operDotMinus( const char* /*name*/ )
78✔
894
{
895
  return BObjectRef( new BError( "Operator .- undefined" ) );
156✔
896
}
897

898
BObjectRef BObjectImp::operDotQMark( const char* /*name*/ )
4✔
899
{
900
  return BObjectRef( new BError( "Operator .? undefined" ) );
8✔
901
}
902

903
}  // namespace Pol::Bscript
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc