rustyphoenixlecture 1.7.0

This project aims to provide a simple a powerfull lecture compilation to generate html web sites
/***************************************
	Auteur : Pierre Aubert
	Mail : pierre.aubert@lapp.in2p3.fr
	Licence : CeCILL-C
****************************************/

use std::fmt;
use std::path::PathBuf;

///Location of a file
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PLocation{
	///Path to the file
	p_filename: PathBuf,
	///Current line in the file
	p_current_line: usize,
	///Current column in the current line of the file
	p_current_col: usize,
}

impl fmt::Display for PLocation {
	///Display the PLocation
	/// # Parameters
	/// - `f` : formater to be used
	/// # Returns
	/// formater result
	#[inline]
	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
		write!(f, "{:?}:{}:{}", self.p_filename, self.p_current_line, self.p_current_col)
	}
}

impl PLocation{
	///Constructor of a PLocation
	/// # Parameters
	/// - `filename` : path to the file
	/// - `current_line` : current line in the file
	/// - `current_col` : current column in the current line of the file
	/// # Returns
	/// Initialised PLocation
	pub fn new(filename: &PathBuf, current_line: usize, current_col: usize) -> Self{
		PLocation {
			p_filename: filename.clone(),
			p_current_line: current_line,
			p_current_col: current_col
		}
	}
	///Set the current line of the PLocation
	/// # Parameters
	/// - `current_line` : current line of the PLocation
	pub fn set_current_line(&mut self, current_line: usize){
		self.p_current_line = current_line;
	}
	///Set the current column of the PLocation
	/// # Parameters
	/// - `current_col`: Current column of the PLocation
	pub fn set_current_col(&mut self, current_col: usize){
		self.p_current_col = current_col;
	}
	///Get the filename of the PLocation
	/// # Returns
	/// Filename of the PLocation
	pub fn get_filename(&self) -> &PathBuf{
		&self.p_filename
	}
	///Get the current line of the PLocation
	/// # Returns
	/// Current line of the PLocation
	pub fn get_current_line(&self) -> usize{
		self.p_current_line
	}
	///Get the current column of the PLocation
	/// # Returns
	/// Current column of the PLocation
	pub fn get_current_col(&self) -> usize{
		self.p_current_col
	}
}