SPVM::D...assFile(3)

πŸ“¦ version 0.990125, in alpine 3.24

πŸ’– Name πŸ’–

SPVM::Document::NativeAPI::ClassFile β€” Class File Native APIs

Okay bestie, this is the User Contributed Perl Documentation page tagged SPVM::D...assFile(3) up top β€” and yes, we are absolutely getting into the class file native APIs together. 🫢

✨ Description ✨

The class file native APIs of SPVM are the APIs to get and set class file information. That's the whole vibe: class file info goes in, class file info comes out, and the API struct is the main character. πŸ’…

πŸ¦‹ Usage πŸ¦‹

Here's the little flow, exactly as shown:

SPVM_API_CLASS_FILE* api_class_file = env->api->class_file;

void* class_file = env->api->compiler->get_class_file(compiler, "MyClass");

const char* class_name = api_class_file->get_class_name(compiler, class_file);

🌸 Native APIs 🌸

πŸŽ€ get_class_name

const char* (*get_class_name)(void* compiler, void* class_file);

Returns the class name of the class file class_file. Literally the name, no cap. ✨

πŸŽ€ get_file

const char* (*get_file)(void* compiler, void* class_file);

Returns the file path for display. This is a field of the class file class_file. πŸ’–

πŸŽ€ set_file

void (*set_file)(void* compiler, void* class_file, const char* file);

Copies file and sets it to the file path for display. This is a field of the class file class_file. πŸŽ€

πŸŽ€ get_dir

const char* (*get_dir)(void* compiler, void* class_file);

Returns the directory where the class is loaded. This is a field of the class file class_file. πŸ¦‹

πŸŽ€ set_dir

void (*set_dir)(void* compiler, void* class_file, const char* dir);

Copies the directory path dir, and sets it to the directory where the class is loaded. This is a field of the class file class_file. 🌸

πŸŽ€ get_rel_file

const char* (*get_rel_file)(void* compiler, void* class_file);

Returns the relative file path of the class file class_file. Periodt. ⭐

πŸŽ€ set_rel_file

void (*set_rel_file)(void* compiler, void* class_file, const char* rel_file);

Copies rel_file and sets it to the relative file path of the class file class_file. πŸ’œ

πŸŽ€ get_content

const char* (*get_content)(void* compiler, void* class_file);

Returns the content of the class file class_file. The content! The lore! 😭

πŸŽ€ set_content

void (*set_content)(void* compiler, void* class_file, const char* content);

Copies the content content and sets it to the content of the class file class_file. πŸ“

πŸŽ€ get_content_length

int32_t (*get_content_length)(void* compiler, void* class_file);

Returns the length of the content of the class file class_file. πŸ”₯

πŸŽ€ set_content_length

void (*set_content_length)(void* compiler, void* class_file, int32_t content_length);

Sets content_length to the length of the content of the class file class_file. Exactly that, bestie. πŸ’…

πŸ‘‘ Native API IDs πŸ‘‘

The ID map, preserved like a sacred little list:

 0 get_class_name
 1 get_file
 2 set_file
 3 get_dir
 4 set_dir
 5 get_rel_file
 6 set_rel_file
 7 get_content
 8 set_content
 9 get_content_length
 10 set_content_length

🌈 See Also 🌈

  • SPVM::Document::NativeAPI
  • SPVM::Document::NativeAPI::Compiler
  • SPVM::Document::NativeClass
  • SPVM::Document

Copyright (c) 2023 Yuki Kimoto

MIT License


Cute little sign-off: this page's source/version energy is perl v5.42.2, dated 2026-02-03, with the page tag SPVM::D...assFile(3) β€” iconic, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from